@babylonjs/viewer 7.40.3 → 7.40.4-alpha
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.
- package/assets/photoStudio.env +0 -0
- package/dist/babylon-viewer.esm.js +2 -0
- package/dist/babylon-viewer.esm.js.map +1 -0
- package/dist/babylon-viewer.esm.min.js +2 -0
- package/dist/babylon-viewer.esm.min.js.map +1 -0
- package/dist/chunks/EXT_lights_ies-B7tVMCka.esm.min.js +2 -0
- package/dist/chunks/EXT_lights_ies-B7tVMCka.esm.min.js.map +1 -0
- package/dist/chunks/EXT_lights_ies-T0Tkc0j0.esm.js +84 -0
- package/dist/chunks/EXT_lights_ies-T0Tkc0j0.esm.js.map +1 -0
- package/dist/chunks/EXT_lights_image_based-CyoPcoDC.esm.min.js +2 -0
- package/dist/chunks/EXT_lights_image_based-CyoPcoDC.esm.min.js.map +1 -0
- package/dist/chunks/EXT_lights_image_based-TRLY00MY.esm.js +171 -0
- package/dist/chunks/EXT_lights_image_based-TRLY00MY.esm.js.map +1 -0
- package/dist/chunks/EXT_mesh_gpu_instancing-CNSWr-2o.esm.js +86 -0
- package/dist/chunks/EXT_mesh_gpu_instancing-CNSWr-2o.esm.js.map +1 -0
- package/dist/chunks/EXT_mesh_gpu_instancing-DvkytavO.esm.min.js +2 -0
- package/dist/chunks/EXT_mesh_gpu_instancing-DvkytavO.esm.min.js.map +1 -0
- package/dist/chunks/EXT_meshopt_compression-C5Jf55Kx.esm.min.js +2 -0
- package/dist/chunks/EXT_meshopt_compression-C5Jf55Kx.esm.min.js.map +1 -0
- package/dist/chunks/EXT_meshopt_compression-CWVLJCmT.esm.js +134 -0
- package/dist/chunks/EXT_meshopt_compression-CWVLJCmT.esm.js.map +1 -0
- package/dist/chunks/EXT_texture_avif-Bv2Pa-Lr.esm.js +44 -0
- package/dist/chunks/EXT_texture_avif-Bv2Pa-Lr.esm.js.map +1 -0
- package/dist/chunks/EXT_texture_avif-DZmsorD-.esm.min.js +2 -0
- package/dist/chunks/EXT_texture_avif-DZmsorD-.esm.min.js.map +1 -0
- package/dist/chunks/EXT_texture_webp-CBpWQrqC.esm.js +43 -0
- package/dist/chunks/EXT_texture_webp-CBpWQrqC.esm.js.map +1 -0
- package/dist/chunks/EXT_texture_webp-D6RSOJSe.esm.min.js +2 -0
- package/dist/chunks/EXT_texture_webp-D6RSOJSe.esm.min.js.map +1 -0
- package/dist/chunks/ExtrasAsMetadata-6ZohdbjJ.esm.js +64 -0
- package/dist/chunks/ExtrasAsMetadata-6ZohdbjJ.esm.js.map +1 -0
- package/dist/chunks/ExtrasAsMetadata-CrG2l0Kf.esm.min.js +2 -0
- package/dist/chunks/ExtrasAsMetadata-CrG2l0Kf.esm.min.js.map +1 -0
- package/dist/chunks/KHR_animation_pointer-Cvu5a-gj.esm.js +352 -0
- package/dist/chunks/KHR_animation_pointer-Cvu5a-gj.esm.js.map +1 -0
- package/dist/chunks/KHR_animation_pointer-Rk2uzfDp.esm.min.js +2 -0
- package/dist/chunks/KHR_animation_pointer-Rk2uzfDp.esm.min.js.map +1 -0
- package/dist/chunks/KHR_draco_mesh_compression-BrXprwd5.esm.js +610 -0
- package/dist/chunks/KHR_draco_mesh_compression-BrXprwd5.esm.js.map +1 -0
- package/dist/chunks/KHR_draco_mesh_compression-Iv3q50MG.esm.min.js +2 -0
- package/dist/chunks/KHR_draco_mesh_compression-Iv3q50MG.esm.min.js.map +1 -0
- package/dist/chunks/KHR_interactivity-B4iFgkk7.esm.min.js +2 -0
- package/dist/chunks/KHR_interactivity-B4iFgkk7.esm.min.js.map +1 -0
- package/dist/chunks/KHR_interactivity-Db4iHU65.esm.js +4033 -0
- package/dist/chunks/KHR_interactivity-Db4iHU65.esm.js.map +1 -0
- package/dist/chunks/KHR_lights_punctual-B7yNiRZy.esm.min.js +2 -0
- package/dist/chunks/KHR_lights_punctual-B7yNiRZy.esm.min.js.map +1 -0
- package/dist/chunks/KHR_lights_punctual-iZl19DTA.esm.js +581 -0
- package/dist/chunks/KHR_lights_punctual-iZl19DTA.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_anisotropy-Bk9K0k0q.esm.js +65 -0
- package/dist/chunks/KHR_materials_anisotropy-Bk9K0k0q.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_anisotropy-DlDnL4o4.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_anisotropy-DlDnL4o4.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_clearcoat-BrT4VgMS.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_clearcoat-BrT4VgMS.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_clearcoat-DXAyxIfA.esm.js +96 -0
- package/dist/chunks/KHR_materials_clearcoat-DXAyxIfA.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_diffuse_transmission-CRqI4Umg.esm.js +97 -0
- package/dist/chunks/KHR_materials_diffuse_transmission-CRqI4Umg.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_diffuse_transmission-jyVvmpFx.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_diffuse_transmission-jyVvmpFx.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_dispersion-BwXQSsRC.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_dispersion-BwXQSsRC.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_dispersion-DTMaHZal.esm.js +62 -0
- package/dist/chunks/KHR_materials_dispersion-DTMaHZal.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_emissive_strength-BCWSR6Zg.esm.js +55 -0
- package/dist/chunks/KHR_materials_emissive_strength-BCWSR6Zg.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_emissive_strength-dEqNWrU4.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_emissive_strength-dEqNWrU4.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_ior-DXmoDlX8.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_ior-DXmoDlX8.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_ior-NvWqR2ZR.esm.js +64 -0
- package/dist/chunks/KHR_materials_ior-NvWqR2ZR.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_iridescence-2VKZo_Mv.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_iridescence-2VKZo_Mv.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_iridescence-B2wLtYQ4.esm.js +72 -0
- package/dist/chunks/KHR_materials_iridescence-B2wLtYQ4.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DYK5fci0.esm.js +81 -0
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DYK5fci0.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-PlzNRHwZ.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_pbrSpecularGlossiness-PlzNRHwZ.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_sheen-CvA19viC.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_sheen-CvA19viC.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_sheen-DY8Hlw2C.esm.js +85 -0
- package/dist/chunks/KHR_materials_sheen-DY8Hlw2C.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_specular-DPankAYO.esm.js +75 -0
- package/dist/chunks/KHR_materials_specular-DPankAYO.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_specular-SFjYTaHn.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_specular-SFjYTaHn.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_transmission-CBvCfGeN.esm.js +307 -0
- package/dist/chunks/KHR_materials_transmission-CBvCfGeN.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_transmission-DeRHqgMd.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_transmission-DeRHqgMd.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_unlit-Dp-VzfY2.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_unlit-Dp-VzfY2.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_unlit-xG3eIsVn.esm.js +74 -0
- package/dist/chunks/KHR_materials_unlit-xG3eIsVn.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_variants-DtTs7enl.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_variants-DtTs7enl.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_variants-POauQPs7.esm.js +262 -0
- package/dist/chunks/KHR_materials_variants-POauQPs7.esm.js.map +1 -0
- package/dist/chunks/KHR_materials_volume-BO1lvsUq.esm.min.js +2 -0
- package/dist/chunks/KHR_materials_volume-BO1lvsUq.esm.min.js.map +1 -0
- package/dist/chunks/KHR_materials_volume-BqCunks7.esm.js +87 -0
- package/dist/chunks/KHR_materials_volume-BqCunks7.esm.js.map +1 -0
- package/dist/chunks/KHR_mesh_quantization-3ON-a5Bz.esm.js +26 -0
- package/dist/chunks/KHR_mesh_quantization-3ON-a5Bz.esm.js.map +1 -0
- package/dist/chunks/KHR_mesh_quantization-C1uR5Lci.esm.min.js +2 -0
- package/dist/chunks/KHR_mesh_quantization-C1uR5Lci.esm.min.js.map +1 -0
- package/dist/chunks/KHR_node_hoverability-CZIi0X9e.esm.js +39 -0
- package/dist/chunks/KHR_node_hoverability-CZIi0X9e.esm.js.map +1 -0
- package/dist/chunks/KHR_node_hoverability-gPD0oS5c.esm.min.js +2 -0
- package/dist/chunks/KHR_node_hoverability-gPD0oS5c.esm.min.js.map +1 -0
- package/dist/chunks/KHR_node_visibility-B5fFI1TX.esm.js +46 -0
- package/dist/chunks/KHR_node_visibility-B5fFI1TX.esm.js.map +1 -0
- package/dist/chunks/KHR_node_visibility-DPw-0W4p.esm.min.js +2 -0
- package/dist/chunks/KHR_node_visibility-DPw-0W4p.esm.min.js.map +1 -0
- package/dist/chunks/KHR_texture_basisu-D6tStneN.esm.min.js +2 -0
- package/dist/chunks/KHR_texture_basisu-D6tStneN.esm.min.js.map +1 -0
- package/dist/chunks/KHR_texture_basisu-Did7TM-4.esm.js +43 -0
- package/dist/chunks/KHR_texture_basisu-Did7TM-4.esm.js.map +1 -0
- package/dist/chunks/KHR_texture_transform-Da5NeRUm.esm.js +63 -0
- package/dist/chunks/KHR_texture_transform-Da5NeRUm.esm.js.map +1 -0
- package/dist/chunks/KHR_texture_transform-jNMzm3zb.esm.min.js +2 -0
- package/dist/chunks/KHR_texture_transform-jNMzm3zb.esm.min.js.map +1 -0
- package/dist/chunks/KHR_xmp_json_ld-D514my_a.esm.js +51 -0
- package/dist/chunks/KHR_xmp_json_ld-D514my_a.esm.js.map +1 -0
- package/dist/chunks/KHR_xmp_json_ld-D5Gbko_w.esm.min.js +2 -0
- package/dist/chunks/KHR_xmp_json_ld-D5Gbko_w.esm.min.js.map +1 -0
- package/dist/chunks/MSFT_audio_emitter-CiB3yG6v.esm.js +2201 -0
- package/dist/chunks/MSFT_audio_emitter-CiB3yG6v.esm.js.map +1 -0
- package/dist/chunks/MSFT_audio_emitter-Cn-DCgMh.esm.min.js +2 -0
- package/dist/chunks/MSFT_audio_emitter-Cn-DCgMh.esm.min.js.map +1 -0
- package/dist/chunks/MSFT_lod-BDP9fUoB.esm.js +337 -0
- package/dist/chunks/MSFT_lod-BDP9fUoB.esm.js.map +1 -0
- package/dist/chunks/MSFT_lod-BEbIdncN.esm.min.js +2 -0
- package/dist/chunks/MSFT_lod-BEbIdncN.esm.min.js.map +1 -0
- package/dist/chunks/MSFT_minecraftMesh-jASzndfE.esm.min.js +2 -0
- package/dist/chunks/MSFT_minecraftMesh-jASzndfE.esm.min.js.map +1 -0
- package/dist/chunks/MSFT_minecraftMesh-mKnNUrKI.esm.js +46 -0
- package/dist/chunks/MSFT_minecraftMesh-mKnNUrKI.esm.js.map +1 -0
- package/dist/chunks/MSFT_sRGBFactors-B1Bk1U5N.esm.min.js +2 -0
- package/dist/chunks/MSFT_sRGBFactors-B1Bk1U5N.esm.min.js.map +1 -0
- package/dist/chunks/MSFT_sRGBFactors-IZnSmmDU.esm.js +47 -0
- package/dist/chunks/MSFT_sRGBFactors-IZnSmmDU.esm.js.map +1 -0
- package/dist/chunks/animationGroup-B1YyqoTa.esm.js +2482 -0
- package/dist/chunks/animationGroup-B1YyqoTa.esm.js.map +1 -0
- package/dist/chunks/animationGroup-C9C7qST_.esm.min.js +2 -0
- package/dist/chunks/animationGroup-C9C7qST_.esm.min.js.map +1 -0
- package/dist/chunks/assetContainer-BzlRl_4x.esm.js +1720 -0
- package/dist/chunks/assetContainer-BzlRl_4x.esm.js.map +1 -0
- package/dist/chunks/assetContainer-D7C3a-Xn.esm.min.js +2 -0
- package/dist/chunks/assetContainer-D7C3a-Xn.esm.min.js.map +1 -0
- package/dist/chunks/audioEngine-BZB34VjD.esm.js +305 -0
- package/dist/chunks/audioEngine-BZB34VjD.esm.js.map +1 -0
- package/dist/chunks/audioEngine-BoxJPZL7.esm.min.js +2 -0
- package/dist/chunks/audioEngine-BoxJPZL7.esm.min.js.map +1 -0
- package/dist/chunks/bakedVertexAnimation-BQki1eZ4.esm.min.js +2 -0
- package/dist/chunks/bakedVertexAnimation-BQki1eZ4.esm.min.js.map +1 -0
- package/dist/chunks/bakedVertexAnimation-DpSHNKcC.esm.js +114 -0
- package/dist/chunks/bakedVertexAnimation-DpSHNKcC.esm.js.map +1 -0
- package/dist/chunks/basisTextureLoader-C3RlzqZl.esm.min.js +2 -0
- package/dist/chunks/basisTextureLoader-C3RlzqZl.esm.min.js.map +1 -0
- package/dist/chunks/basisTextureLoader-D6uyehp2.esm.js +600 -0
- package/dist/chunks/basisTextureLoader-D6uyehp2.esm.js.map +1 -0
- package/dist/chunks/dds-C1QgDMMC.esm.min.js +2 -0
- package/dist/chunks/dds-C1QgDMMC.esm.min.js.map +1 -0
- package/dist/chunks/dds-zApWiwah.esm.js +540 -0
- package/dist/chunks/dds-zApWiwah.esm.js.map +1 -0
- package/dist/chunks/ddsTextureLoader-CSYQAUdw.esm.js +88 -0
- package/dist/chunks/ddsTextureLoader-CSYQAUdw.esm.js.map +1 -0
- package/dist/chunks/ddsTextureLoader-Dyl2CjaG.esm.min.js +2 -0
- package/dist/chunks/ddsTextureLoader-Dyl2CjaG.esm.min.js.map +1 -0
- package/dist/chunks/decalFragment-BbsT8PSx.esm.min.js +2 -0
- package/dist/chunks/decalFragment-BbsT8PSx.esm.min.js.map +1 -0
- package/dist/chunks/decalFragment-DqgT4NiX.esm.js +18 -0
- package/dist/chunks/decalFragment-DqgT4NiX.esm.js.map +1 -0
- package/dist/chunks/default.fragment-Bpw23SLq.esm.min.js +2 -0
- package/dist/chunks/default.fragment-Bpw23SLq.esm.min.js.map +1 -0
- package/dist/chunks/default.fragment-C8lcinV9.esm.js +446 -0
- package/dist/chunks/default.fragment-C8lcinV9.esm.js.map +1 -0
- package/dist/chunks/default.fragment-De3FJCJD.esm.js +515 -0
- package/dist/chunks/default.fragment-De3FJCJD.esm.js.map +1 -0
- package/dist/chunks/default.fragment-b__nAv93.esm.min.js +2 -0
- package/dist/chunks/default.fragment-b__nAv93.esm.min.js.map +1 -0
- package/dist/chunks/default.vertex-BnpZVKdz.esm.min.js +2 -0
- package/dist/chunks/default.vertex-BnpZVKdz.esm.min.js.map +1 -0
- package/dist/chunks/default.vertex-CD2qxrmB.esm.js +190 -0
- package/dist/chunks/default.vertex-CD2qxrmB.esm.js.map +1 -0
- package/dist/chunks/default.vertex-CN5WYROZ.esm.min.js +2 -0
- package/dist/chunks/default.vertex-CN5WYROZ.esm.min.js.map +1 -0
- package/dist/chunks/default.vertex-DRHq60qX.esm.js +211 -0
- package/dist/chunks/default.vertex-DRHq60qX.esm.js.map +1 -0
- package/dist/chunks/defaultUboDeclaration-C0gMCjYL.esm.min.js +2 -0
- package/dist/chunks/defaultUboDeclaration-C0gMCjYL.esm.min.js.map +1 -0
- package/dist/chunks/defaultUboDeclaration-CGRrluBg.esm.min.js +2 -0
- package/dist/chunks/defaultUboDeclaration-CGRrluBg.esm.min.js.map +1 -0
- package/dist/chunks/defaultUboDeclaration-DCybxQ0F.esm.js +13 -0
- package/dist/chunks/defaultUboDeclaration-DCybxQ0F.esm.js.map +1 -0
- package/dist/chunks/defaultUboDeclaration-xxIrKyXf.esm.js +15 -0
- package/dist/chunks/defaultUboDeclaration-xxIrKyXf.esm.js.map +1 -0
- package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js +11 -0
- package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js.map +1 -0
- package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js +2 -0
- package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js.map +1 -0
- package/dist/chunks/dumpTools-BOVGklo2.esm.min.js +2 -0
- package/dist/chunks/dumpTools-BOVGklo2.esm.min.js.map +1 -0
- package/dist/chunks/dumpTools-Dy-fD64p.esm.js +200 -0
- package/dist/chunks/dumpTools-Dy-fD64p.esm.js.map +1 -0
- package/dist/chunks/engine-CBGABL2W.esm.min.js +2 -0
- package/dist/chunks/engine-CBGABL2W.esm.min.js.map +1 -0
- package/dist/chunks/engine-D9Sn-BC6.esm.js +2213 -0
- package/dist/chunks/engine-D9Sn-BC6.esm.js.map +1 -0
- package/dist/chunks/engine.common-BM1GAef8.esm.js +1162 -0
- package/dist/chunks/engine.common-BM1GAef8.esm.js.map +1 -0
- package/dist/chunks/engine.common-xMH7x2b0.esm.min.js +2 -0
- package/dist/chunks/engine.common-xMH7x2b0.esm.min.js.map +1 -0
- package/dist/chunks/envTextureLoader-BRdNaVH2.esm.min.js +2 -0
- package/dist/chunks/envTextureLoader-BRdNaVH2.esm.min.js.map +1 -0
- package/dist/chunks/envTextureLoader-DT_xwrde.esm.js +64 -0
- package/dist/chunks/envTextureLoader-DT_xwrde.esm.js.map +1 -0
- package/dist/chunks/environmentTextureTools-BxWsgzT8.esm.min.js +2 -0
- package/dist/chunks/environmentTextureTools-BxWsgzT8.esm.min.js.map +1 -0
- package/dist/chunks/environmentTextureTools-DuNLB_SE.esm.js +382 -0
- package/dist/chunks/environmentTextureTools-DuNLB_SE.esm.js.map +1 -0
- package/dist/chunks/exrTextureLoader-BBL1-v_g.esm.min.js +2 -0
- package/dist/chunks/exrTextureLoader-BBL1-v_g.esm.min.js.map +1 -0
- package/dist/chunks/exrTextureLoader-CUiWw4Oh.esm.js +1683 -0
- package/dist/chunks/exrTextureLoader-CUiWw4Oh.esm.js.map +1 -0
- package/dist/chunks/fogFragment-BCz1GIrJ.esm.min.js +2 -0
- package/dist/chunks/fogFragment-BCz1GIrJ.esm.min.js.map +1 -0
- package/dist/chunks/fogFragment-BQLWFsYl.esm.min.js +2 -0
- package/dist/chunks/fogFragment-BQLWFsYl.esm.min.js.map +1 -0
- package/dist/chunks/fogFragment-DANl-YQk.esm.js +102 -0
- package/dist/chunks/fogFragment-DANl-YQk.esm.js.map +1 -0
- package/dist/chunks/fogFragment-DptoygQ5.esm.js +101 -0
- package/dist/chunks/fogFragment-DptoygQ5.esm.js.map +1 -0
- package/dist/chunks/fresnelFunction-3-z89NGn.esm.js +12 -0
- package/dist/chunks/fresnelFunction-3-z89NGn.esm.js.map +1 -0
- package/dist/chunks/fresnelFunction-CbnLfwWn.esm.min.js +2 -0
- package/dist/chunks/fresnelFunction-CbnLfwWn.esm.min.js.map +1 -0
- package/dist/chunks/glTFLoader-Qw5JObwf.esm.js +7658 -0
- package/dist/chunks/glTFLoader-Qw5JObwf.esm.js.map +1 -0
- package/dist/chunks/glTFLoader-iKlvKEG-.esm.min.js +2 -0
- package/dist/chunks/glTFLoader-iKlvKEG-.esm.min.js.map +1 -0
- package/dist/chunks/glTFLoaderAnimation-BCUZthxT.esm.js +77 -0
- package/dist/chunks/glTFLoaderAnimation-BCUZthxT.esm.js.map +1 -0
- package/dist/chunks/glTFLoaderAnimation-DnTkRibM.esm.min.js +2 -0
- package/dist/chunks/glTFLoaderAnimation-DnTkRibM.esm.min.js.map +1 -0
- package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +2 -0
- package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +1 -0
- package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +67 -0
- package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +1 -0
- package/dist/chunks/harmonicsFunctions-19PWyV81.esm.js +34 -0
- package/dist/chunks/harmonicsFunctions-19PWyV81.esm.js.map +1 -0
- package/dist/chunks/harmonicsFunctions-D4sp7bHN.esm.js +35 -0
- package/dist/chunks/harmonicsFunctions-D4sp7bHN.esm.js.map +1 -0
- package/dist/chunks/harmonicsFunctions-DSpaTpH7.esm.min.js +2 -0
- package/dist/chunks/harmonicsFunctions-DSpaTpH7.esm.min.js.map +1 -0
- package/dist/chunks/harmonicsFunctions-DvH68s1g.esm.min.js +2 -0
- package/dist/chunks/harmonicsFunctions-DvH68s1g.esm.min.js.map +1 -0
- package/dist/chunks/hdrTextureLoader-ChbZ5_1g.esm.min.js +2 -0
- package/dist/chunks/hdrTextureLoader-ChbZ5_1g.esm.min.js.map +1 -0
- package/dist/chunks/hdrTextureLoader-OJaopXAb.esm.js +253 -0
- package/dist/chunks/hdrTextureLoader-OJaopXAb.esm.js.map +1 -0
- package/dist/chunks/helperFunctions-CNCeKea7.esm.js +81 -0
- package/dist/chunks/helperFunctions-CNCeKea7.esm.js.map +1 -0
- package/dist/chunks/helperFunctions-Crs36Q3w.esm.js +109 -0
- package/dist/chunks/helperFunctions-Crs36Q3w.esm.js.map +1 -0
- package/dist/chunks/helperFunctions-DKz6om6i.esm.min.js +2 -0
- package/dist/chunks/helperFunctions-DKz6om6i.esm.min.js.map +1 -0
- package/dist/chunks/helperFunctions-bZhuioWn.esm.min.js +2 -0
- package/dist/chunks/helperFunctions-bZhuioWn.esm.min.js.map +1 -0
- package/dist/chunks/iesTextureLoader-BTOaWdIK.esm.js +189 -0
- package/dist/chunks/iesTextureLoader-BTOaWdIK.esm.js.map +1 -0
- package/dist/chunks/iesTextureLoader-CKnu1maC.esm.min.js +2 -0
- package/dist/chunks/iesTextureLoader-CKnu1maC.esm.min.js.map +1 -0
- package/dist/chunks/index-5L5wXyrx.esm.js +74870 -0
- package/dist/chunks/index-5L5wXyrx.esm.js.map +1 -0
- package/dist/chunks/index-B5KLkjYm.esm.min.js +57 -0
- package/dist/chunks/index-B5KLkjYm.esm.min.js.map +1 -0
- package/dist/chunks/ktxTextureLoader-CMfHt5rp.esm.js +814 -0
- package/dist/chunks/ktxTextureLoader-CMfHt5rp.esm.js.map +1 -0
- package/dist/chunks/ktxTextureLoader-DCyzShol.esm.min.js +2 -0
- package/dist/chunks/ktxTextureLoader-DCyzShol.esm.min.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-8CuoGLY6.esm.js +35 -0
- package/dist/chunks/logDepthDeclaration-8CuoGLY6.esm.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-BC68Ktb0.esm.js +11 -0
- package/dist/chunks/logDepthDeclaration-BC68Ktb0.esm.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-CgPuLaM9.esm.min.js +2 -0
- package/dist/chunks/logDepthDeclaration-CgPuLaM9.esm.min.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-iNYm9mSn.esm.min.js +2 -0
- package/dist/chunks/logDepthDeclaration-iNYm9mSn.esm.min.js.map +1 -0
- package/dist/chunks/logDepthVertex-BOepIJij.esm.js +77 -0
- package/dist/chunks/logDepthVertex-BOepIJij.esm.js.map +1 -0
- package/dist/chunks/logDepthVertex-Bno6ozc-.esm.min.js +2 -0
- package/dist/chunks/logDepthVertex-Bno6ozc-.esm.min.js.map +1 -0
- package/dist/chunks/logDepthVertex-CU3WBwOA.esm.js +81 -0
- package/dist/chunks/logDepthVertex-CU3WBwOA.esm.js.map +1 -0
- package/dist/chunks/logDepthVertex-DjeubcPn.esm.min.js +2 -0
- package/dist/chunks/logDepthVertex-DjeubcPn.esm.min.js.map +1 -0
- package/dist/chunks/mainUVVaryingDeclaration-C_Am-o4e.esm.js +11 -0
- package/dist/chunks/mainUVVaryingDeclaration-C_Am-o4e.esm.js.map +1 -0
- package/dist/chunks/mainUVVaryingDeclaration-CuSqEhkE.esm.min.js +2 -0
- package/dist/chunks/mainUVVaryingDeclaration-CuSqEhkE.esm.min.js.map +1 -0
- package/dist/chunks/mainUVVaryingDeclaration-DxqJq0-m.esm.js +11 -0
- package/dist/chunks/mainUVVaryingDeclaration-DxqJq0-m.esm.js.map +1 -0
- package/dist/chunks/mainUVVaryingDeclaration-oZF0xIut.esm.min.js +2 -0
- package/dist/chunks/mainUVVaryingDeclaration-oZF0xIut.esm.min.js.map +1 -0
- package/dist/chunks/mesh.vertexData.functions-B_pMCAzZ.esm.js +119 -0
- package/dist/chunks/mesh.vertexData.functions-B_pMCAzZ.esm.js.map +1 -0
- package/dist/chunks/mesh.vertexData.functions-Bo7e6Of9.esm.min.js +2 -0
- package/dist/chunks/mesh.vertexData.functions-Bo7e6Of9.esm.min.js.map +1 -0
- package/dist/chunks/meshUboDeclaration-BWuUYN5-.esm.js +26 -0
- package/dist/chunks/meshUboDeclaration-BWuUYN5-.esm.js.map +1 -0
- package/dist/chunks/meshUboDeclaration-D-9f-79D.esm.min.js +2 -0
- package/dist/chunks/meshUboDeclaration-D-9f-79D.esm.min.js.map +1 -0
- package/dist/chunks/objFileLoader-B3PzHlWB.esm.min.js +2 -0
- package/dist/chunks/objFileLoader-B3PzHlWB.esm.min.js.map +1 -0
- package/dist/chunks/objFileLoader-BjHr-pn1.esm.js +1338 -0
- package/dist/chunks/objFileLoader-BjHr-pn1.esm.js.map +1 -0
- package/dist/chunks/oitFragment-BypZDJVo.esm.min.js +2 -0
- package/dist/chunks/oitFragment-BypZDJVo.esm.min.js.map +1 -0
- package/dist/chunks/oitFragment-D3g8w3hO.esm.js +1078 -0
- package/dist/chunks/oitFragment-D3g8w3hO.esm.js.map +1 -0
- package/dist/chunks/oitFragment-Db3h4DV5.esm.min.js +2 -0
- package/dist/chunks/oitFragment-Db3h4DV5.esm.min.js.map +1 -0
- package/dist/chunks/oitFragment-tQJLudg5.esm.js +1240 -0
- package/dist/chunks/oitFragment-tQJLudg5.esm.js.map +1 -0
- package/dist/chunks/pass.fragment-C8CWeVkM.esm.js +15 -0
- package/dist/chunks/pass.fragment-C8CWeVkM.esm.js.map +1 -0
- package/dist/chunks/pass.fragment-CSK2ynPe.esm.js +15 -0
- package/dist/chunks/pass.fragment-CSK2ynPe.esm.js.map +1 -0
- package/dist/chunks/pass.fragment-CdgLWa1Q.esm.min.js +2 -0
- package/dist/chunks/pass.fragment-CdgLWa1Q.esm.min.js.map +1 -0
- package/dist/chunks/pass.fragment-ONNyQPrD.esm.min.js +2 -0
- package/dist/chunks/pass.fragment-ONNyQPrD.esm.min.js.map +1 -0
- package/dist/chunks/pbr.fragment-Be9mZgL7.esm.js +3269 -0
- package/dist/chunks/pbr.fragment-Be9mZgL7.esm.js.map +1 -0
- package/dist/chunks/pbr.fragment-C13t4f7Z.esm.min.js +2 -0
- package/dist/chunks/pbr.fragment-C13t4f7Z.esm.min.js.map +1 -0
- package/dist/chunks/pbr.fragment-CiAe6mgr.esm.js +3222 -0
- package/dist/chunks/pbr.fragment-CiAe6mgr.esm.js.map +1 -0
- package/dist/chunks/pbr.fragment-I66pqwoX.esm.min.js +2 -0
- package/dist/chunks/pbr.fragment-I66pqwoX.esm.min.js.map +1 -0
- package/dist/chunks/pbr.vertex-BlqPEcZe.esm.js +223 -0
- package/dist/chunks/pbr.vertex-BlqPEcZe.esm.js.map +1 -0
- package/dist/chunks/pbr.vertex-C1r_QFvZ.esm.min.js +2 -0
- package/dist/chunks/pbr.vertex-C1r_QFvZ.esm.min.js.map +1 -0
- package/dist/chunks/pbr.vertex-DE9NTHal.esm.min.js +2 -0
- package/dist/chunks/pbr.vertex-DE9NTHal.esm.min.js.map +1 -0
- package/dist/chunks/pbr.vertex-oQpu2zia.esm.js +348 -0
- package/dist/chunks/pbr.vertex-oQpu2zia.esm.js.map +1 -0
- package/dist/chunks/postprocess.vertex-D3XLqa14.esm.js +20 -0
- package/dist/chunks/postprocess.vertex-D3XLqa14.esm.js.map +1 -0
- package/dist/chunks/postprocess.vertex-IkQbrBQH.esm.min.js +2 -0
- package/dist/chunks/postprocess.vertex-IkQbrBQH.esm.min.js.map +1 -0
- package/dist/chunks/rawTexture-BVf9vm87.esm.js +191 -0
- package/dist/chunks/rawTexture-BVf9vm87.esm.js.map +1 -0
- package/dist/chunks/rawTexture-CNxyCiVq.esm.min.js +2 -0
- package/dist/chunks/rawTexture-CNxyCiVq.esm.min.js.map +1 -0
- package/dist/chunks/ray-BLVbie8S.esm.min.js +2 -0
- package/dist/chunks/ray-BLVbie8S.esm.min.js.map +1 -0
- package/dist/chunks/ray-C7H9vp-x.esm.js +946 -0
- package/dist/chunks/ray-C7H9vp-x.esm.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-9dPOcBOA.esm.min.js +2 -0
- package/dist/chunks/rgbdDecode.fragment-9dPOcBOA.esm.min.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-ApyH83v_.esm.js +13 -0
- package/dist/chunks/rgbdDecode.fragment-ApyH83v_.esm.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-Bt75XOUV.esm.min.js +2 -0
- package/dist/chunks/rgbdDecode.fragment-Bt75XOUV.esm.min.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-DDIJs9ID.esm.js +13 -0
- package/dist/chunks/rgbdDecode.fragment-DDIJs9ID.esm.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-CSquf6K4.esm.js +13 -0
- package/dist/chunks/rgbdEncode.fragment-CSquf6K4.esm.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-Cpudy2qT.esm.js +13 -0
- package/dist/chunks/rgbdEncode.fragment-Cpudy2qT.esm.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-DZs59_tV.esm.min.js +2 -0
- package/dist/chunks/rgbdEncode.fragment-DZs59_tV.esm.min.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-Djxd-azW.esm.min.js +2 -0
- package/dist/chunks/rgbdEncode.fragment-Djxd-azW.esm.min.js.map +1 -0
- package/dist/chunks/splatFileLoader-BkExyfY6.esm.js +3379 -0
- package/dist/chunks/splatFileLoader-BkExyfY6.esm.js.map +1 -0
- package/dist/chunks/splatFileLoader-DLc_wKu4.esm.min.js +2 -0
- package/dist/chunks/splatFileLoader-DLc_wKu4.esm.min.js.map +1 -0
- package/dist/chunks/spotLight-CFGRpcFc.esm.js +701 -0
- package/dist/chunks/spotLight-CFGRpcFc.esm.js.map +1 -0
- package/dist/chunks/spotLight-z5HIEQmM.esm.min.js +2 -0
- package/dist/chunks/spotLight-z5HIEQmM.esm.min.js.map +1 -0
- package/dist/chunks/standardMaterial-B5u9Vzil.esm.min.js +2 -0
- package/dist/chunks/standardMaterial-B5u9Vzil.esm.min.js.map +1 -0
- package/dist/chunks/standardMaterial-BJzDZ72T.esm.js +1806 -0
- package/dist/chunks/standardMaterial-BJzDZ72T.esm.js.map +1 -0
- package/dist/chunks/stlFileLoader-B3Y6u4L6.esm.min.js +2 -0
- package/dist/chunks/stlFileLoader-B3Y6u4L6.esm.min.js.map +1 -0
- package/dist/chunks/stlFileLoader-Bd1GgkYU.esm.js +238 -0
- package/dist/chunks/stlFileLoader-Bd1GgkYU.esm.js.map +1 -0
- package/dist/chunks/tgaTextureLoader-BD_A6gyw.esm.min.js +2 -0
- package/dist/chunks/tgaTextureLoader-BD_A6gyw.esm.min.js.map +1 -0
- package/dist/chunks/tgaTextureLoader-DnUiJRBO.esm.js +349 -0
- package/dist/chunks/tgaTextureLoader-DnUiJRBO.esm.js.map +1 -0
- package/dist/chunks/thinEngine-CRNAFHqA.esm.min.js +2 -0
- package/dist/chunks/thinEngine-CRNAFHqA.esm.min.js.map +1 -0
- package/dist/chunks/thinEngine-DGyFDxzW.esm.js +3853 -0
- package/dist/chunks/thinEngine-DGyFDxzW.esm.js.map +1 -0
- package/dist/chunks/thinInstanceMesh-B-f1KNB2.esm.min.js +2 -0
- package/dist/chunks/thinInstanceMesh-B-f1KNB2.esm.min.js.map +1 -0
- package/dist/chunks/thinInstanceMesh-D-cofgbF.esm.js +314 -0
- package/dist/chunks/thinInstanceMesh-D-cofgbF.esm.js.map +1 -0
- package/dist/chunks/vertexColorMixing-BUqoiJkS.esm.min.js +2 -0
- package/dist/chunks/vertexColorMixing-BUqoiJkS.esm.min.js.map +1 -0
- package/dist/chunks/vertexColorMixing-CBpXxGvM.esm.js +421 -0
- package/dist/chunks/vertexColorMixing-CBpXxGvM.esm.js.map +1 -0
- package/dist/chunks/vertexColorMixing-ChUhO7eS.esm.js +531 -0
- package/dist/chunks/vertexColorMixing-ChUhO7eS.esm.js.map +1 -0
- package/dist/chunks/vertexColorMixing-DbmkfWMo.esm.min.js +2 -0
- package/dist/chunks/vertexColorMixing-DbmkfWMo.esm.min.js.map +1 -0
- package/dist/chunks/webgpuEngine-DqprhQ4L.esm.js +11538 -0
- package/dist/chunks/webgpuEngine-DqprhQ4L.esm.js.map +1 -0
- package/dist/chunks/webgpuEngine-LpKjcEuV.esm.min.js +2 -0
- package/dist/chunks/webgpuEngine-LpKjcEuV.esm.min.js.map +1 -0
- package/dist/chunks/workerPool-BUOov2K1.esm.js +122 -0
- package/dist/chunks/workerPool-BUOov2K1.esm.js.map +1 -0
- package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js +2 -0
- package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js.map +1 -0
- package/lib/index.d.ts +591 -0
- package/lib/index.js +2165 -0
- package/lib/index.js.map +1 -0
- package/package.json +19 -28
- package/readme.md +28 -28
- package/configuration/configuration.d.ts +0 -107
- package/configuration/configuration.js +0 -16
- package/configuration/configuration.js.map +0 -1
- package/configuration/configurationCompatibility.d.ts +0 -8
- package/configuration/configurationCompatibility.js +0 -66
- package/configuration/configurationCompatibility.js.map +0 -1
- package/configuration/configurationContainer.d.ts +0 -10
- package/configuration/configurationContainer.js +0 -10
- package/configuration/configurationContainer.js.map +0 -1
- package/configuration/globals.d.ts +0 -6
- package/configuration/globals.js +0 -18
- package/configuration/globals.js.map +0 -1
- package/configuration/index.d.ts +0 -2
- package/configuration/index.js +0 -4
- package/configuration/index.js.map +0 -1
- package/configuration/interfaces/cameraConfiguration.d.ts +0 -31
- package/configuration/interfaces/cameraConfiguration.js +0 -2
- package/configuration/interfaces/cameraConfiguration.js.map +0 -1
- package/configuration/interfaces/colorGradingConfiguration.d.ts +0 -81
- package/configuration/interfaces/colorGradingConfiguration.js +0 -2
- package/configuration/interfaces/colorGradingConfiguration.js.map +0 -1
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +0 -20
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +0 -2
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +0 -1
- package/configuration/interfaces/environmentMapConfiguration.d.ts +0 -22
- package/configuration/interfaces/environmentMapConfiguration.js +0 -2
- package/configuration/interfaces/environmentMapConfiguration.js.map +0 -1
- package/configuration/interfaces/groundConfiguration.d.ts +0 -24
- package/configuration/interfaces/groundConfiguration.js +0 -2
- package/configuration/interfaces/groundConfiguration.js.map +0 -1
- package/configuration/interfaces/imageProcessingConfiguration.d.ts +0 -45
- package/configuration/interfaces/imageProcessingConfiguration.js +0 -2
- package/configuration/interfaces/imageProcessingConfiguration.js.map +0 -1
- package/configuration/interfaces/index.d.ts +0 -15
- package/configuration/interfaces/index.js +0 -16
- package/configuration/interfaces/index.js.map +0 -1
- package/configuration/interfaces/lightConfiguration.d.ts +0 -60
- package/configuration/interfaces/lightConfiguration.js +0 -2
- package/configuration/interfaces/lightConfiguration.js.map +0 -1
- package/configuration/interfaces/modelAnimationConfiguration.d.ts +0 -26
- package/configuration/interfaces/modelAnimationConfiguration.js +0 -2
- package/configuration/interfaces/modelAnimationConfiguration.js.map +0 -1
- package/configuration/interfaces/modelConfiguration.d.ts +0 -65
- package/configuration/interfaces/modelConfiguration.js +0 -2
- package/configuration/interfaces/modelConfiguration.js.map +0 -1
- package/configuration/interfaces/observersConfiguration.d.ts +0 -5
- package/configuration/interfaces/observersConfiguration.js +0 -2
- package/configuration/interfaces/observersConfiguration.js.map +0 -1
- package/configuration/interfaces/sceneConfiguration.d.ts +0 -48
- package/configuration/interfaces/sceneConfiguration.js +0 -2
- package/configuration/interfaces/sceneConfiguration.js.map +0 -1
- package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +0 -23
- package/configuration/interfaces/sceneOptimizerConfiguration.js +0 -2
- package/configuration/interfaces/sceneOptimizerConfiguration.js.map +0 -1
- package/configuration/interfaces/skyboxConfiguration.d.ts +0 -21
- package/configuration/interfaces/skyboxConfiguration.js +0 -2
- package/configuration/interfaces/skyboxConfiguration.js.map +0 -1
- package/configuration/interfaces/templateConfiguration.d.ts +0 -67
- package/configuration/interfaces/templateConfiguration.js +0 -2
- package/configuration/interfaces/templateConfiguration.js.map +0 -1
- package/configuration/interfaces/vrConfiguration.d.ts +0 -16
- package/configuration/interfaces/vrConfiguration.js +0 -2
- package/configuration/interfaces/vrConfiguration.js.map +0 -1
- package/configuration/loader.d.ts +0 -4
- package/configuration/loader.js +0 -17
- package/configuration/loader.js.map +0 -1
- package/configuration/mappers.d.ts +0 -43
- package/configuration/mappers.js +0 -193
- package/configuration/mappers.js.map +0 -1
- package/configuration/renderOnlyLoader.d.ts +0 -33
- package/configuration/renderOnlyLoader.js +0 -162
- package/configuration/renderOnlyLoader.js.map +0 -1
- package/configuration/types/default.d.ts +0 -6
- package/configuration/types/default.js +0 -121
- package/configuration/types/default.js.map +0 -1
- package/configuration/types/environmentMap.d.ts +0 -5
- package/configuration/types/environmentMap.js +0 -14
- package/configuration/types/environmentMap.js.map +0 -1
- package/configuration/types/extended.d.ts +0 -6
- package/configuration/types/extended.js +0 -317
- package/configuration/types/extended.js.map +0 -1
- package/configuration/types/index.d.ts +0 -14
- package/configuration/types/index.js +0 -51
- package/configuration/types/index.js.map +0 -1
- package/configuration/types/minimal.d.ts +0 -6
- package/configuration/types/minimal.js +0 -43
- package/configuration/types/minimal.js.map +0 -1
- package/configuration/types/renderOnlyDefault.d.ts +0 -30
- package/configuration/types/renderOnlyDefault.js +0 -31
- package/configuration/types/renderOnlyDefault.js.map +0 -1
- package/configuration/types/shadowLight.d.ts +0 -9
- package/configuration/types/shadowLight.js +0 -64
- package/configuration/types/shadowLight.js.map +0 -1
- package/helper/index.d.ts +0 -29
- package/helper/index.js +0 -66
- package/helper/index.js.map +0 -1
- package/index.d.ts +0 -30
- package/index.js +0 -46
- package/index.js.map +0 -1
- package/initializer.d.ts +0 -11
- package/initializer.js +0 -35
- package/initializer.js.map +0 -1
- package/interfaces.d.ts +0 -5
- package/interfaces.js +0 -7
- package/interfaces.js.map +0 -1
- package/labs/environmentSerializer.d.ts +0 -126
- package/labs/environmentSerializer.js +0 -191
- package/labs/environmentSerializer.js.map +0 -1
- package/labs/texture.d.ts +0 -183
- package/labs/texture.js +0 -351
- package/labs/texture.js.map +0 -1
- package/labs/viewerLabs.d.ts +0 -51
- package/labs/viewerLabs.js +0 -134
- package/labs/viewerLabs.js.map +0 -1
- package/loader/modelLoader.d.ts +0 -56
- package/loader/modelLoader.js +0 -202
- package/loader/modelLoader.js.map +0 -1
- package/loader/plugins/applyMaterialConfig.d.ts +0 -12
- package/loader/plugins/applyMaterialConfig.js +0 -16
- package/loader/plugins/applyMaterialConfig.js.map +0 -1
- package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +0 -9
- package/loader/plugins/extendedMaterialLoaderPlugin.js +0 -16
- package/loader/plugins/extendedMaterialLoaderPlugin.js.map +0 -1
- package/loader/plugins/index.d.ts +0 -19
- package/loader/plugins/index.js +0 -44
- package/loader/plugins/index.js.map +0 -1
- package/loader/plugins/loaderPlugin.d.ts +0 -24
- package/loader/plugins/loaderPlugin.js +0 -2
- package/loader/plugins/loaderPlugin.js.map +0 -1
- package/loader/plugins/msftLodLoaderPlugin.d.ts +0 -12
- package/loader/plugins/msftLodLoaderPlugin.js +0 -21
- package/loader/plugins/msftLodLoaderPlugin.js.map +0 -1
- package/loader/plugins/telemetryLoaderPlugin.d.ts +0 -12
- package/loader/plugins/telemetryLoaderPlugin.js +0 -36
- package/loader/plugins/telemetryLoaderPlugin.js.map +0 -1
- package/managers/observablesManager.d.ts +0 -66
- package/managers/observablesManager.js +0 -35
- package/managers/observablesManager.js.map +0 -1
- package/managers/sceneManager.d.ts +0 -245
- package/managers/sceneManager.js +0 -1375
- package/managers/sceneManager.js.map +0 -1
- package/managers/telemetryManager.d.ts +0 -78
- package/managers/telemetryManager.js +0 -117
- package/managers/telemetryManager.js.map +0 -1
- package/model/modelAnimation.d.ts +0 -215
- package/model/modelAnimation.js +0 -237
- package/model/modelAnimation.js.map +0 -1
- package/model/viewerModel.d.ts +0 -233
- package/model/viewerModel.js +0 -673
- package/model/viewerModel.js.map +0 -1
- package/optimizer/custom/extended.d.ts +0 -13
- package/optimizer/custom/extended.js +0 -101
- package/optimizer/custom/extended.js.map +0 -1
- package/optimizer/custom/index.d.ts +0 -9
- package/optimizer/custom/index.js +0 -26
- package/optimizer/custom/index.js.map +0 -1
- package/renderOnlyIndex.d.ts +0 -11
- package/renderOnlyIndex.js +0 -18
- package/renderOnlyIndex.js.map +0 -1
- package/templating/eventManager.d.ts +0 -35
- package/templating/eventManager.js +0 -66
- package/templating/eventManager.js.map +0 -1
- package/templating/plugins/hdButtonPlugin.d.ts +0 -9
- package/templating/plugins/hdButtonPlugin.js +0 -22
- package/templating/plugins/hdButtonPlugin.js.map +0 -1
- package/templating/plugins/printButton.d.ts +0 -9
- package/templating/plugins/printButton.js +0 -41
- package/templating/plugins/printButton.js.map +0 -1
- package/templating/templateManager.d.ts +0 -197
- package/templating/templateManager.js +0 -561
- package/templating/templateManager.js.map +0 -1
- package/templating/viewerTemplatePlugin.d.ts +0 -21
- package/templating/viewerTemplatePlugin.js +0 -69
- package/templating/viewerTemplatePlugin.js.map +0 -1
- package/viewer/defaultViewer.d.ts +0 -130
- package/viewer/defaultViewer.js +0 -672
- package/viewer/defaultViewer.js.map +0 -1
- package/viewer/renderOnlyViewer.d.ts +0 -9
- package/viewer/renderOnlyViewer.js +0 -46
- package/viewer/renderOnlyViewer.js.map +0 -1
- package/viewer/viewer.d.ts +0 -258
- package/viewer/viewer.js +0 -783
- package/viewer/viewer.js.map +0 -1
- package/viewer/viewerManager.d.ts +0 -58
- package/viewer/viewerManager.js +0 -91
- package/viewer/viewerManager.js.map +0 -1
- package/viewer/viewerWithTemplate.d.ts +0 -9
- package/viewer/viewerWithTemplate.js +0 -20
- package/viewer/viewerWithTemplate.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webgpuEngine-LpKjcEuV.esm.min.js","sources":["../../../../../dev/core/dist/Engines/WebGPU/webgpuTextureHelper.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuPerfCounter.js","../../../../../dev/core/dist/Engines/thinWebGPUEngine.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuConstants.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuShaderProcessor.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuPipelineContext.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuShaderProcessingContext.js","../../../../../dev/core/dist/Misc/codeStringParsingTools.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuShaderProcessorsGLSL.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuShaderProcessorsWGSL.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuHardwareTexture.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuTextureManager.js","../../../../../dev/core/dist/Meshes/WebGPU/webgpuDataBuffer.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuBufferManager.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuCacheSampler.js","../../../../../dev/core/dist/Buffers/buffer.nonFloatVertexBuffers.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuCacheRenderPipeline.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuCacheRenderPipelineTree.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuStencilStateComposer.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuDepthCullingState.js","../../../../../dev/core/dist/Materials/Textures/externalTexture.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuMaterialContext.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuDrawContext.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuCacheBindGroups.js","../../../../../dev/core/dist/ShadersWGSL/clearQuad.vertex.js","../../../../../dev/core/dist/ShadersWGSL/clearQuad.fragment.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuClearQuad.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuBundleList.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuQuerySet.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuTimestampQuery.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuOcclusionQuery.js","../../../../../dev/core/dist/Engines/Processors/shaderCodeInliner.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuTintWASM.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuSnapshotRendering.js","../../../../../dev/core/dist/Buffers/buffer.align.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuExternalTexture.js","../../../../../dev/core/dist/Engines/WebGPU/Extensions/engine.rawTexture.js","../../../../../dev/core/dist/Engines/WebGPU/Extensions/engine.alpha.js","../../../../../dev/core/dist/Engines/WebGPU/Extensions/engine.readTexture.js","../../../../../dev/core/dist/Engines/WebGPU/Extensions/engine.cubeTexture.js","../../../../../dev/core/dist/Engines/WebGPU/webgpuRenderTargetWrapper.js","../../../../../dev/core/dist/Engines/WebGPU/Extensions/engine.renderTarget.js","../../../../../dev/core/dist/Engines/WebGPU/Extensions/engine.renderTargetTexture.js","../../../../../dev/core/dist/Engines/WebGPU/Extensions/engine.renderTargetCube.js","../../../../../dev/core/dist/Engines/AbstractEngine/abstractEngine.query.js","../../../../../dev/core/dist/Engines/WebGPU/Extensions/engine.query.js","../../../../../dev/core/dist/Engines/webgpuEngine.js"],"sourcesContent":["import { ILog2 } from \"../../Maths/math.scalar.functions\";\nimport { Constants } from \"../constants\";\n/** @internal */\nexport class WebGPUTextureHelper {\n static ComputeNumMipmapLevels(width, height) {\n return ILog2(Math.max(width, height)) + 1;\n }\n static GetTextureTypeFromFormat(format) {\n switch (format) {\n // One Component = 8 bits unsigned\n case \"r8unorm\" /* WebGPUConstants.TextureFormat.R8Unorm */:\n case \"r8uint\" /* WebGPUConstants.TextureFormat.R8Uint */:\n case \"rg8unorm\" /* WebGPUConstants.TextureFormat.RG8Unorm */:\n case \"rg8uint\" /* WebGPUConstants.TextureFormat.RG8Uint */:\n case \"rgba8unorm\" /* WebGPUConstants.TextureFormat.RGBA8Unorm */:\n case \"rgba8unorm-srgb\" /* WebGPUConstants.TextureFormat.RGBA8UnormSRGB */:\n case \"rgba8uint\" /* WebGPUConstants.TextureFormat.RGBA8Uint */:\n case \"bgra8unorm\" /* WebGPUConstants.TextureFormat.BGRA8Unorm */:\n case \"bgra8unorm-srgb\" /* WebGPUConstants.TextureFormat.BGRA8UnormSRGB */:\n case \"rgb10a2uint\" /* WebGPUConstants.TextureFormat.RGB10A2UINT */: // composite format - let's say it's byte...\n case \"rgb10a2unorm\" /* WebGPUConstants.TextureFormat.RGB10A2Unorm */: // composite format - let's say it's byte...\n case \"rgb9e5ufloat\" /* WebGPUConstants.TextureFormat.RGB9E5UFloat */: // composite format - let's say it's byte...\n case \"rg11b10ufloat\" /* WebGPUConstants.TextureFormat.RG11B10UFloat */: // composite format - let's say it's byte...\n case \"bc7-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC7RGBAUnorm */:\n case \"bc7-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB */:\n case \"bc6h-rgb-ufloat\" /* WebGPUConstants.TextureFormat.BC6HRGBUFloat */:\n case \"bc5-rg-unorm\" /* WebGPUConstants.TextureFormat.BC5RGUnorm */:\n case \"bc3-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC3RGBAUnorm */:\n case \"bc3-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB */:\n case \"bc2-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC2RGBAUnorm */:\n case \"bc2-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB */:\n case \"bc4-r-unorm\" /* WebGPUConstants.TextureFormat.BC4RUnorm */:\n case \"bc1-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC1RGBAUnorm */:\n case \"bc1-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB */:\n case \"etc2-rgb8unorm\" /* WebGPUConstants.TextureFormat.ETC2RGB8Unorm */:\n case \"etc2-rgb8unorm-srgb\" /* WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB */:\n case \"etc2-rgb8a1unorm\" /* WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm */:\n case \"etc2-rgb8a1unorm-srgb\" /* WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB */:\n case \"etc2-rgba8unorm\" /* WebGPUConstants.TextureFormat.ETC2RGBA8Unorm */:\n case \"etc2-rgba8unorm-srgb\" /* WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB */:\n case \"eac-r11unorm\" /* WebGPUConstants.TextureFormat.EACR11Unorm */:\n case \"eac-rg11unorm\" /* WebGPUConstants.TextureFormat.EACRG11Unorm */:\n case \"astc-4x4-unorm\" /* WebGPUConstants.TextureFormat.ASTC4x4Unorm */:\n case \"astc-4x4-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB */:\n case \"astc-5x4-unorm\" /* WebGPUConstants.TextureFormat.ASTC5x4Unorm */:\n case \"astc-5x4-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB */:\n case \"astc-5x5-unorm\" /* WebGPUConstants.TextureFormat.ASTC5x5Unorm */:\n case \"astc-5x5-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB */:\n case \"astc-6x5-unorm\" /* WebGPUConstants.TextureFormat.ASTC6x5Unorm */:\n case \"astc-6x5-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB */:\n case \"astc-6x6-unorm\" /* WebGPUConstants.TextureFormat.ASTC6x6Unorm */:\n case \"astc-6x6-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB */:\n case \"astc-8x5-unorm\" /* WebGPUConstants.TextureFormat.ASTC8x5Unorm */:\n case \"astc-8x5-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB */:\n case \"astc-8x6-unorm\" /* WebGPUConstants.TextureFormat.ASTC8x6Unorm */:\n case \"astc-8x6-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB */:\n case \"astc-8x8-unorm\" /* WebGPUConstants.TextureFormat.ASTC8x8Unorm */:\n case \"astc-8x8-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB */:\n case \"astc-10x5-unorm\" /* WebGPUConstants.TextureFormat.ASTC10x5Unorm */:\n case \"astc-10x5-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB */:\n case \"astc-10x6-unorm\" /* WebGPUConstants.TextureFormat.ASTC10x6Unorm */:\n case \"astc-10x6-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB */:\n case \"astc-10x8-unorm\" /* WebGPUConstants.TextureFormat.ASTC10x8Unorm */:\n case \"astc-10x8-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB */:\n case \"astc-10x10-unorm\" /* WebGPUConstants.TextureFormat.ASTC10x10Unorm */:\n case \"astc-10x10-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB */:\n case \"astc-12x10-unorm\" /* WebGPUConstants.TextureFormat.ASTC12x10Unorm */:\n case \"astc-12x10-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB */:\n case \"astc-12x12-unorm\" /* WebGPUConstants.TextureFormat.ASTC12x12Unorm */:\n case \"astc-12x12-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB */:\n case \"stencil8\" /* WebGPUConstants.TextureFormat.Stencil8 */:\n return Constants.TEXTURETYPE_UNSIGNED_BYTE;\n // One Component = 8 bits signed\n case \"r8snorm\" /* WebGPUConstants.TextureFormat.R8Snorm */:\n case \"r8sint\" /* WebGPUConstants.TextureFormat.R8Sint */:\n case \"rg8snorm\" /* WebGPUConstants.TextureFormat.RG8Snorm */:\n case \"rg8sint\" /* WebGPUConstants.TextureFormat.RG8Sint */:\n case \"rgba8snorm\" /* WebGPUConstants.TextureFormat.RGBA8Snorm */:\n case \"rgba8sint\" /* WebGPUConstants.TextureFormat.RGBA8Sint */:\n case \"bc6h-rgb-float\" /* WebGPUConstants.TextureFormat.BC6HRGBFloat */:\n case \"bc5-rg-snorm\" /* WebGPUConstants.TextureFormat.BC5RGSnorm */:\n case \"bc4-r-snorm\" /* WebGPUConstants.TextureFormat.BC4RSnorm */:\n case \"eac-r11snorm\" /* WebGPUConstants.TextureFormat.EACR11Snorm */:\n case \"eac-rg11snorm\" /* WebGPUConstants.TextureFormat.EACRG11Snorm */:\n return Constants.TEXTURETYPE_BYTE;\n // One component = 16 bits unsigned\n case \"r16uint\" /* WebGPUConstants.TextureFormat.R16Uint */:\n case \"r16unorm\" /* WebGPUConstants.TextureFormat.R16Unorm */:\n case \"rg16unorm\" /* WebGPUConstants.TextureFormat.RG16Unorm */:\n case \"rgba16unorm\" /* WebGPUConstants.TextureFormat.RGBA16Unorm */:\n case \"rg16uint\" /* WebGPUConstants.TextureFormat.RG16Uint */:\n case \"rgba16uint\" /* WebGPUConstants.TextureFormat.RGBA16Uint */:\n case \"depth16unorm\" /* WebGPUConstants.TextureFormat.Depth16Unorm */:\n return Constants.TEXTURETYPE_UNSIGNED_SHORT;\n // One component = 16 bits signed\n case \"r16sint\" /* WebGPUConstants.TextureFormat.R16Sint */:\n case \"r16snorm\" /* WebGPUConstants.TextureFormat.R16Snorm */:\n case \"rg16snorm\" /* WebGPUConstants.TextureFormat.RG16Snorm */:\n case \"rgba16snorm\" /* WebGPUConstants.TextureFormat.RGBA16Snorm */:\n case \"rg16sint\" /* WebGPUConstants.TextureFormat.RG16Sint */:\n case \"rgba16sint\" /* WebGPUConstants.TextureFormat.RGBA16Sint */:\n return Constants.TEXTURETYPE_SHORT;\n case \"r16float\" /* WebGPUConstants.TextureFormat.R16Float */:\n case \"rg16float\" /* WebGPUConstants.TextureFormat.RG16Float */:\n case \"rgba16float\" /* WebGPUConstants.TextureFormat.RGBA16Float */:\n return Constants.TEXTURETYPE_HALF_FLOAT;\n // One component = 32 bits unsigned\n case \"r32uint\" /* WebGPUConstants.TextureFormat.R32Uint */:\n case \"rg32uint\" /* WebGPUConstants.TextureFormat.RG32Uint */:\n case \"rgba32uint\" /* WebGPUConstants.TextureFormat.RGBA32Uint */:\n return Constants.TEXTURETYPE_UNSIGNED_INTEGER;\n // One component = 32 bits signed\n case \"r32sint\" /* WebGPUConstants.TextureFormat.R32Sint */:\n case \"rg32sint\" /* WebGPUConstants.TextureFormat.RG32Sint */:\n case \"rgba32sint\" /* WebGPUConstants.TextureFormat.RGBA32Sint */:\n return Constants.TEXTURETYPE_UNSIGNED_INTEGER;\n case \"r32float\" /* WebGPUConstants.TextureFormat.R32Float */:\n case \"rg32float\" /* WebGPUConstants.TextureFormat.RG32Float */:\n case \"rgba32float\" /* WebGPUConstants.TextureFormat.RGBA32Float */:\n case \"depth32float\" /* WebGPUConstants.TextureFormat.Depth32Float */:\n case \"depth32float-stencil8\" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:\n case \"depth24plus\" /* WebGPUConstants.TextureFormat.Depth24Plus */:\n case \"depth24plus-stencil8\" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:\n return Constants.TEXTURETYPE_FLOAT;\n }\n return Constants.TEXTURETYPE_UNSIGNED_BYTE;\n }\n static GetBlockInformationFromFormat(format) {\n switch (format) {\n // 8 bits formats\n case \"r8unorm\" /* WebGPUConstants.TextureFormat.R8Unorm */:\n case \"r8snorm\" /* WebGPUConstants.TextureFormat.R8Snorm */:\n case \"r8uint\" /* WebGPUConstants.TextureFormat.R8Uint */:\n case \"r8sint\" /* WebGPUConstants.TextureFormat.R8Sint */:\n return { width: 1, height: 1, length: 1 };\n // 16 bits formats\n case \"r16uint\" /* WebGPUConstants.TextureFormat.R16Uint */:\n case \"r16sint\" /* WebGPUConstants.TextureFormat.R16Sint */:\n case \"r16unorm\" /* WebGPUConstants.TextureFormat.R16Unorm */:\n case \"rg16unorm\" /* WebGPUConstants.TextureFormat.RG16Unorm */:\n case \"rgba16unorm\" /* WebGPUConstants.TextureFormat.RGBA16Unorm */:\n case \"r16snorm\" /* WebGPUConstants.TextureFormat.R16Snorm */:\n case \"rg16snorm\" /* WebGPUConstants.TextureFormat.RG16Snorm */:\n case \"rgba16snorm\" /* WebGPUConstants.TextureFormat.RGBA16Snorm */:\n case \"r16float\" /* WebGPUConstants.TextureFormat.R16Float */:\n case \"rg8unorm\" /* WebGPUConstants.TextureFormat.RG8Unorm */:\n case \"rg8snorm\" /* WebGPUConstants.TextureFormat.RG8Snorm */:\n case \"rg8uint\" /* WebGPUConstants.TextureFormat.RG8Uint */:\n case \"rg8sint\" /* WebGPUConstants.TextureFormat.RG8Sint */:\n return { width: 1, height: 1, length: 2 };\n // 32 bits formats\n case \"r32uint\" /* WebGPUConstants.TextureFormat.R32Uint */:\n case \"r32sint\" /* WebGPUConstants.TextureFormat.R32Sint */:\n case \"r32float\" /* WebGPUConstants.TextureFormat.R32Float */:\n case \"rg16uint\" /* WebGPUConstants.TextureFormat.RG16Uint */:\n case \"rg16sint\" /* WebGPUConstants.TextureFormat.RG16Sint */:\n case \"rg16float\" /* WebGPUConstants.TextureFormat.RG16Float */:\n case \"rgba8unorm\" /* WebGPUConstants.TextureFormat.RGBA8Unorm */:\n case \"rgba8unorm-srgb\" /* WebGPUConstants.TextureFormat.RGBA8UnormSRGB */:\n case \"rgba8snorm\" /* WebGPUConstants.TextureFormat.RGBA8Snorm */:\n case \"rgba8uint\" /* WebGPUConstants.TextureFormat.RGBA8Uint */:\n case \"rgba8sint\" /* WebGPUConstants.TextureFormat.RGBA8Sint */:\n case \"bgra8unorm\" /* WebGPUConstants.TextureFormat.BGRA8Unorm */:\n case \"bgra8unorm-srgb\" /* WebGPUConstants.TextureFormat.BGRA8UnormSRGB */:\n case \"rgb9e5ufloat\" /* WebGPUConstants.TextureFormat.RGB9E5UFloat */:\n case \"rgb10a2uint\" /* WebGPUConstants.TextureFormat.RGB10A2UINT */:\n case \"rgb10a2unorm\" /* WebGPUConstants.TextureFormat.RGB10A2Unorm */:\n case \"rg11b10ufloat\" /* WebGPUConstants.TextureFormat.RG11B10UFloat */:\n return { width: 1, height: 1, length: 4 };\n // 64 bits formats\n case \"rg32uint\" /* WebGPUConstants.TextureFormat.RG32Uint */:\n case \"rg32sint\" /* WebGPUConstants.TextureFormat.RG32Sint */:\n case \"rg32float\" /* WebGPUConstants.TextureFormat.RG32Float */:\n case \"rgba16uint\" /* WebGPUConstants.TextureFormat.RGBA16Uint */:\n case \"rgba16sint\" /* WebGPUConstants.TextureFormat.RGBA16Sint */:\n case \"rgba16float\" /* WebGPUConstants.TextureFormat.RGBA16Float */:\n return { width: 1, height: 1, length: 8 };\n // 128 bits formats\n case \"rgba32uint\" /* WebGPUConstants.TextureFormat.RGBA32Uint */:\n case \"rgba32sint\" /* WebGPUConstants.TextureFormat.RGBA32Sint */:\n case \"rgba32float\" /* WebGPUConstants.TextureFormat.RGBA32Float */:\n return { width: 1, height: 1, length: 16 };\n // Depth and stencil formats\n case \"stencil8\" /* WebGPUConstants.TextureFormat.Stencil8 */:\n // eslint-disable-next-line no-throw-literal\n throw \"No fixed size for Stencil8 format!\";\n case \"depth16unorm\" /* WebGPUConstants.TextureFormat.Depth16Unorm */:\n return { width: 1, height: 1, length: 2 };\n case \"depth24plus\" /* WebGPUConstants.TextureFormat.Depth24Plus */:\n // eslint-disable-next-line no-throw-literal\n throw \"No fixed size for Depth24Plus format!\";\n case \"depth24plus-stencil8\" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:\n // eslint-disable-next-line no-throw-literal\n throw \"No fixed size for Depth24PlusStencil8 format!\";\n case \"depth32float\" /* WebGPUConstants.TextureFormat.Depth32Float */:\n return { width: 1, height: 1, length: 4 };\n case \"depth32float-stencil8\" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:\n return { width: 1, height: 1, length: 5 };\n // BC compressed formats usable if \"texture-compression-bc\" is both\n // supported by the device/user agent and enabled in requestDevice.\n case \"bc7-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC7RGBAUnorm */:\n case \"bc7-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB */:\n case \"bc6h-rgb-ufloat\" /* WebGPUConstants.TextureFormat.BC6HRGBUFloat */:\n case \"bc6h-rgb-float\" /* WebGPUConstants.TextureFormat.BC6HRGBFloat */:\n case \"bc5-rg-unorm\" /* WebGPUConstants.TextureFormat.BC5RGUnorm */:\n case \"bc5-rg-snorm\" /* WebGPUConstants.TextureFormat.BC5RGSnorm */:\n case \"bc3-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC3RGBAUnorm */:\n case \"bc3-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB */:\n case \"bc2-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC2RGBAUnorm */:\n case \"bc2-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB */:\n return { width: 4, height: 4, length: 16 };\n case \"bc4-r-unorm\" /* WebGPUConstants.TextureFormat.BC4RUnorm */:\n case \"bc4-r-snorm\" /* WebGPUConstants.TextureFormat.BC4RSnorm */:\n case \"bc1-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC1RGBAUnorm */:\n case \"bc1-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB */:\n return { width: 4, height: 4, length: 8 };\n // ETC2 compressed formats usable if \"texture-compression-etc2\" is both\n // supported by the device/user agent and enabled in requestDevice.\n case \"etc2-rgb8unorm\" /* WebGPUConstants.TextureFormat.ETC2RGB8Unorm */:\n case \"etc2-rgb8unorm-srgb\" /* WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB */:\n case \"etc2-rgb8a1unorm\" /* WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm */:\n case \"etc2-rgb8a1unorm-srgb\" /* WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB */:\n case \"eac-r11unorm\" /* WebGPUConstants.TextureFormat.EACR11Unorm */:\n case \"eac-r11snorm\" /* WebGPUConstants.TextureFormat.EACR11Snorm */:\n return { width: 4, height: 4, length: 8 };\n case \"etc2-rgba8unorm\" /* WebGPUConstants.TextureFormat.ETC2RGBA8Unorm */:\n case \"etc2-rgba8unorm-srgb\" /* WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB */:\n case \"eac-rg11unorm\" /* WebGPUConstants.TextureFormat.EACRG11Unorm */:\n case \"eac-rg11snorm\" /* WebGPUConstants.TextureFormat.EACRG11Snorm */:\n return { width: 4, height: 4, length: 16 };\n // ASTC compressed formats usable if \"texture-compression-astc\" is both\n // supported by the device/user agent and enabled in requestDevice.\n case \"astc-4x4-unorm\" /* WebGPUConstants.TextureFormat.ASTC4x4Unorm */:\n case \"astc-4x4-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB */:\n return { width: 4, height: 4, length: 16 };\n case \"astc-5x4-unorm\" /* WebGPUConstants.TextureFormat.ASTC5x4Unorm */:\n case \"astc-5x4-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB */:\n return { width: 5, height: 4, length: 16 };\n case \"astc-5x5-unorm\" /* WebGPUConstants.TextureFormat.ASTC5x5Unorm */:\n case \"astc-5x5-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB */:\n return { width: 5, height: 5, length: 16 };\n case \"astc-6x5-unorm\" /* WebGPUConstants.TextureFormat.ASTC6x5Unorm */:\n case \"astc-6x5-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB */:\n return { width: 6, height: 5, length: 16 };\n case \"astc-6x6-unorm\" /* WebGPUConstants.TextureFormat.ASTC6x6Unorm */:\n case \"astc-6x6-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB */:\n return { width: 6, height: 6, length: 16 };\n case \"astc-8x5-unorm\" /* WebGPUConstants.TextureFormat.ASTC8x5Unorm */:\n case \"astc-8x5-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB */:\n return { width: 8, height: 5, length: 16 };\n case \"astc-8x6-unorm\" /* WebGPUConstants.TextureFormat.ASTC8x6Unorm */:\n case \"astc-8x6-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB */:\n return { width: 8, height: 6, length: 16 };\n case \"astc-8x8-unorm\" /* WebGPUConstants.TextureFormat.ASTC8x8Unorm */:\n case \"astc-8x8-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB */:\n return { width: 8, height: 8, length: 16 };\n case \"astc-10x5-unorm\" /* WebGPUConstants.TextureFormat.ASTC10x5Unorm */:\n case \"astc-10x5-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB */:\n return { width: 10, height: 5, length: 16 };\n case \"astc-10x6-unorm\" /* WebGPUConstants.TextureFormat.ASTC10x6Unorm */:\n case \"astc-10x6-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB */:\n return { width: 10, height: 6, length: 16 };\n case \"astc-10x8-unorm\" /* WebGPUConstants.TextureFormat.ASTC10x8Unorm */:\n case \"astc-10x8-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB */:\n return { width: 10, height: 8, length: 16 };\n case \"astc-10x10-unorm\" /* WebGPUConstants.TextureFormat.ASTC10x10Unorm */:\n case \"astc-10x10-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB */:\n return { width: 10, height: 10, length: 16 };\n case \"astc-12x10-unorm\" /* WebGPUConstants.TextureFormat.ASTC12x10Unorm */:\n case \"astc-12x10-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB */:\n return { width: 12, height: 10, length: 16 };\n case \"astc-12x12-unorm\" /* WebGPUConstants.TextureFormat.ASTC12x12Unorm */:\n case \"astc-12x12-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB */:\n return { width: 12, height: 12, length: 16 };\n }\n return { width: 1, height: 1, length: 4 };\n }\n static IsHardwareTexture(texture) {\n return !!texture.release;\n }\n static IsInternalTexture(texture) {\n return !!texture.dispose;\n }\n static IsImageBitmap(imageBitmap) {\n return imageBitmap.close !== undefined;\n }\n static IsImageBitmapArray(imageBitmap) {\n return Array.isArray(imageBitmap) && imageBitmap[0].close !== undefined;\n }\n static IsCompressedFormat(format) {\n switch (format) {\n case \"bc7-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB */:\n case \"bc7-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC7RGBAUnorm */:\n case \"bc6h-rgb-float\" /* WebGPUConstants.TextureFormat.BC6HRGBFloat */:\n case \"bc6h-rgb-ufloat\" /* WebGPUConstants.TextureFormat.BC6HRGBUFloat */:\n case \"bc5-rg-snorm\" /* WebGPUConstants.TextureFormat.BC5RGSnorm */:\n case \"bc5-rg-unorm\" /* WebGPUConstants.TextureFormat.BC5RGUnorm */:\n case \"bc4-r-snorm\" /* WebGPUConstants.TextureFormat.BC4RSnorm */:\n case \"bc4-r-unorm\" /* WebGPUConstants.TextureFormat.BC4RUnorm */:\n case \"bc3-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB */:\n case \"bc3-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC3RGBAUnorm */:\n case \"bc2-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB */:\n case \"bc2-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC2RGBAUnorm */:\n case \"bc1-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB */:\n case \"bc1-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC1RGBAUnorm */:\n case \"etc2-rgb8unorm\" /* WebGPUConstants.TextureFormat.ETC2RGB8Unorm */:\n case \"etc2-rgb8unorm-srgb\" /* WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB */:\n case \"etc2-rgb8a1unorm\" /* WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm */:\n case \"etc2-rgb8a1unorm-srgb\" /* WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB */:\n case \"etc2-rgba8unorm\" /* WebGPUConstants.TextureFormat.ETC2RGBA8Unorm */:\n case \"etc2-rgba8unorm-srgb\" /* WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB */:\n case \"eac-r11unorm\" /* WebGPUConstants.TextureFormat.EACR11Unorm */:\n case \"eac-r11snorm\" /* WebGPUConstants.TextureFormat.EACR11Snorm */:\n case \"eac-rg11unorm\" /* WebGPUConstants.TextureFormat.EACRG11Unorm */:\n case \"eac-rg11snorm\" /* WebGPUConstants.TextureFormat.EACRG11Snorm */:\n case \"astc-4x4-unorm\" /* WebGPUConstants.TextureFormat.ASTC4x4Unorm */:\n case \"astc-4x4-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB */:\n case \"astc-5x4-unorm\" /* WebGPUConstants.TextureFormat.ASTC5x4Unorm */:\n case \"astc-5x4-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB */:\n case \"astc-5x5-unorm\" /* WebGPUConstants.TextureFormat.ASTC5x5Unorm */:\n case \"astc-5x5-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB */:\n case \"astc-6x5-unorm\" /* WebGPUConstants.TextureFormat.ASTC6x5Unorm */:\n case \"astc-6x5-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB */:\n case \"astc-6x6-unorm\" /* WebGPUConstants.TextureFormat.ASTC6x6Unorm */:\n case \"astc-6x6-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB */:\n case \"astc-8x5-unorm\" /* WebGPUConstants.TextureFormat.ASTC8x5Unorm */:\n case \"astc-8x5-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB */:\n case \"astc-8x6-unorm\" /* WebGPUConstants.TextureFormat.ASTC8x6Unorm */:\n case \"astc-8x6-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB */:\n case \"astc-8x8-unorm\" /* WebGPUConstants.TextureFormat.ASTC8x8Unorm */:\n case \"astc-8x8-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB */:\n case \"astc-10x5-unorm\" /* WebGPUConstants.TextureFormat.ASTC10x5Unorm */:\n case \"astc-10x5-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB */:\n case \"astc-10x6-unorm\" /* WebGPUConstants.TextureFormat.ASTC10x6Unorm */:\n case \"astc-10x6-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB */:\n case \"astc-10x8-unorm\" /* WebGPUConstants.TextureFormat.ASTC10x8Unorm */:\n case \"astc-10x8-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB */:\n case \"astc-10x10-unorm\" /* WebGPUConstants.TextureFormat.ASTC10x10Unorm */:\n case \"astc-10x10-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB */:\n case \"astc-12x10-unorm\" /* WebGPUConstants.TextureFormat.ASTC12x10Unorm */:\n case \"astc-12x10-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB */:\n case \"astc-12x12-unorm\" /* WebGPUConstants.TextureFormat.ASTC12x12Unorm */:\n case \"astc-12x12-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB */:\n return true;\n }\n return false;\n }\n static GetWebGPUTextureFormat(type, format, useSRGBBuffer = false) {\n switch (format) {\n case Constants.TEXTUREFORMAT_DEPTH16:\n return \"depth16unorm\" /* WebGPUConstants.TextureFormat.Depth16Unorm */;\n case Constants.TEXTUREFORMAT_DEPTH24:\n return \"depth24plus\" /* WebGPUConstants.TextureFormat.Depth24Plus */;\n case Constants.TEXTUREFORMAT_DEPTH24_STENCIL8:\n return \"depth24plus-stencil8\" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */;\n case Constants.TEXTUREFORMAT_DEPTH32_FLOAT:\n return \"depth32float\" /* WebGPUConstants.TextureFormat.Depth32Float */;\n case Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8:\n return \"depth32float-stencil8\" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */;\n case Constants.TEXTUREFORMAT_STENCIL8:\n return \"stencil8\" /* WebGPUConstants.TextureFormat.Stencil8 */;\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM:\n return useSRGBBuffer ? \"bc7-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB */ : \"bc7-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC7RGBAUnorm */;\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT:\n return \"bc6h-rgb-ufloat\" /* WebGPUConstants.TextureFormat.BC6HRGBUFloat */;\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT:\n return \"bc6h-rgb-float\" /* WebGPUConstants.TextureFormat.BC6HRGBFloat */;\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5:\n return useSRGBBuffer ? \"bc3-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB */ : \"bc3-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC3RGBAUnorm */;\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3:\n return useSRGBBuffer ? \"bc2-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB */ : \"bc2-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC2RGBAUnorm */;\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1:\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1:\n return useSRGBBuffer ? \"bc1-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB */ : \"bc1-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC1RGBAUnorm */;\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4:\n return useSRGBBuffer ? \"astc-4x4-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB */ : \"astc-4x4-unorm\" /* WebGPUConstants.TextureFormat.ASTC4x4Unorm */;\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB_ETC1_WEBGL:\n case Constants.TEXTUREFORMAT_COMPRESSED_RGB8_ETC2:\n return useSRGBBuffer ? \"etc2-rgb8unorm-srgb\" /* WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB */ : \"etc2-rgb8unorm\" /* WebGPUConstants.TextureFormat.ETC2RGB8Unorm */;\n case Constants.TEXTUREFORMAT_COMPRESSED_RGBA8_ETC2_EAC:\n return useSRGBBuffer ? \"etc2-rgba8unorm-srgb\" /* WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB */ : \"etc2-rgba8unorm\" /* WebGPUConstants.TextureFormat.ETC2RGBA8Unorm */;\n }\n switch (type) {\n case Constants.TEXTURETYPE_BYTE:\n switch (format) {\n case Constants.TEXTUREFORMAT_RED:\n return \"r8snorm\" /* WebGPUConstants.TextureFormat.R8Snorm */;\n case Constants.TEXTUREFORMAT_RG:\n return \"rg8snorm\" /* WebGPUConstants.TextureFormat.RG8Snorm */;\n case Constants.TEXTUREFORMAT_RGB:\n // eslint-disable-next-line no-throw-literal\n throw \"RGB format not supported in WebGPU\";\n case Constants.TEXTUREFORMAT_RED_INTEGER:\n return \"r8sint\" /* WebGPUConstants.TextureFormat.R8Sint */;\n case Constants.TEXTUREFORMAT_RG_INTEGER:\n return \"rg8sint\" /* WebGPUConstants.TextureFormat.RG8Sint */;\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\n // eslint-disable-next-line no-throw-literal\n throw \"RGB_INTEGER format not supported in WebGPU\";\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\n return \"rgba8sint\" /* WebGPUConstants.TextureFormat.RGBA8Sint */;\n default:\n return \"rgba8snorm\" /* WebGPUConstants.TextureFormat.RGBA8Snorm */;\n }\n case Constants.TEXTURETYPE_UNSIGNED_BYTE:\n switch (format) {\n case Constants.TEXTUREFORMAT_RED:\n return \"r8unorm\" /* WebGPUConstants.TextureFormat.R8Unorm */;\n case Constants.TEXTUREFORMAT_RG:\n return \"rg8unorm\" /* WebGPUConstants.TextureFormat.RG8Unorm */;\n case Constants.TEXTUREFORMAT_RGB:\n // eslint-disable-next-line no-throw-literal\n throw \"TEXTUREFORMAT_RGB format not supported in WebGPU\";\n case Constants.TEXTUREFORMAT_RGBA:\n return useSRGBBuffer ? \"rgba8unorm-srgb\" /* WebGPUConstants.TextureFormat.RGBA8UnormSRGB */ : \"rgba8unorm\" /* WebGPUConstants.TextureFormat.RGBA8Unorm */;\n case Constants.TEXTUREFORMAT_BGRA:\n return useSRGBBuffer ? \"bgra8unorm-srgb\" /* WebGPUConstants.TextureFormat.BGRA8UnormSRGB */ : \"bgra8unorm\" /* WebGPUConstants.TextureFormat.BGRA8Unorm */;\n case Constants.TEXTUREFORMAT_RED_INTEGER:\n return \"r8uint\" /* WebGPUConstants.TextureFormat.R8Uint */;\n case Constants.TEXTUREFORMAT_RG_INTEGER:\n return \"rg8uint\" /* WebGPUConstants.TextureFormat.RG8Uint */;\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\n // eslint-disable-next-line no-throw-literal\n throw \"RGB_INTEGER format not supported in WebGPU\";\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\n return \"rgba8uint\" /* WebGPUConstants.TextureFormat.RGBA8Uint */;\n case Constants.TEXTUREFORMAT_ALPHA:\n // eslint-disable-next-line no-throw-literal\n throw \"TEXTUREFORMAT_ALPHA format not supported in WebGPU\";\n case Constants.TEXTUREFORMAT_LUMINANCE:\n // eslint-disable-next-line no-throw-literal\n throw \"TEXTUREFORMAT_LUMINANCE format not supported in WebGPU\";\n case Constants.TEXTUREFORMAT_LUMINANCE_ALPHA:\n // eslint-disable-next-line no-throw-literal\n throw \"TEXTUREFORMAT_LUMINANCE_ALPHA format not supported in WebGPU\";\n default:\n return \"rgba8unorm\" /* WebGPUConstants.TextureFormat.RGBA8Unorm */;\n }\n case Constants.TEXTURETYPE_SHORT:\n switch (format) {\n case Constants.TEXTUREFORMAT_RED_INTEGER:\n return \"r16sint\" /* WebGPUConstants.TextureFormat.R16Sint */;\n case Constants.TEXTUREFORMAT_RG_INTEGER:\n return \"rg16sint\" /* WebGPUConstants.TextureFormat.RG16Sint */;\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\n // eslint-disable-next-line no-throw-literal\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\n return \"rgba16sint\" /* WebGPUConstants.TextureFormat.RGBA16Sint */;\n default:\n return \"rgba16sint\" /* WebGPUConstants.TextureFormat.RGBA16Sint */;\n }\n case Constants.TEXTURETYPE_UNSIGNED_SHORT:\n switch (format) {\n case Constants.TEXTUREFORMAT_RED_INTEGER:\n return \"r16uint\" /* WebGPUConstants.TextureFormat.R16Uint */;\n case Constants.TEXTUREFORMAT_RG_INTEGER:\n return \"rg16uint\" /* WebGPUConstants.TextureFormat.RG16Uint */;\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\n // eslint-disable-next-line no-throw-literal\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\n return \"rgba16uint\" /* WebGPUConstants.TextureFormat.RGBA16Uint */;\n default:\n return \"rgba16uint\" /* WebGPUConstants.TextureFormat.RGBA16Uint */;\n }\n case Constants.TEXTURETYPE_INT:\n switch (format) {\n case Constants.TEXTUREFORMAT_RED_INTEGER:\n return \"r32sint\" /* WebGPUConstants.TextureFormat.R32Sint */;\n case Constants.TEXTUREFORMAT_RG_INTEGER:\n return \"rg32sint\" /* WebGPUConstants.TextureFormat.RG32Sint */;\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\n // eslint-disable-next-line no-throw-literal\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\n return \"rgba32sint\" /* WebGPUConstants.TextureFormat.RGBA32Sint */;\n default:\n return \"rgba32sint\" /* WebGPUConstants.TextureFormat.RGBA32Sint */;\n }\n case Constants.TEXTURETYPE_UNSIGNED_INTEGER: // Refers to UNSIGNED_INT\n switch (format) {\n case Constants.TEXTUREFORMAT_RED_INTEGER:\n return \"r32uint\" /* WebGPUConstants.TextureFormat.R32Uint */;\n case Constants.TEXTUREFORMAT_RG_INTEGER:\n return \"rg32uint\" /* WebGPUConstants.TextureFormat.RG32Uint */;\n case Constants.TEXTUREFORMAT_RGB_INTEGER:\n // eslint-disable-next-line no-throw-literal\n throw \"TEXTUREFORMAT_RGB_INTEGER format not supported in WebGPU\";\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\n return \"rgba32uint\" /* WebGPUConstants.TextureFormat.RGBA32Uint */;\n default:\n return \"rgba32uint\" /* WebGPUConstants.TextureFormat.RGBA32Uint */;\n }\n case Constants.TEXTURETYPE_FLOAT:\n switch (format) {\n case Constants.TEXTUREFORMAT_RED:\n return \"r32float\" /* WebGPUConstants.TextureFormat.R32Float */; // By default. Other possibility is R16Float.\n case Constants.TEXTUREFORMAT_RG:\n return \"rg32float\" /* WebGPUConstants.TextureFormat.RG32Float */; // By default. Other possibility is RG16Float.\n case Constants.TEXTUREFORMAT_RGB:\n // eslint-disable-next-line no-throw-literal\n throw \"TEXTUREFORMAT_RGB format not supported in WebGPU\";\n case Constants.TEXTUREFORMAT_RGBA:\n return \"rgba32float\" /* WebGPUConstants.TextureFormat.RGBA32Float */; // By default. Other possibility is RGBA16Float.\n default:\n return \"rgba32float\" /* WebGPUConstants.TextureFormat.RGBA32Float */;\n }\n case Constants.TEXTURETYPE_HALF_FLOAT:\n switch (format) {\n case Constants.TEXTUREFORMAT_RED:\n return \"r16float\" /* WebGPUConstants.TextureFormat.R16Float */;\n case Constants.TEXTUREFORMAT_RG:\n return \"rg16float\" /* WebGPUConstants.TextureFormat.RG16Float */;\n case Constants.TEXTUREFORMAT_RGB:\n // eslint-disable-next-line no-throw-literal\n throw \"TEXTUREFORMAT_RGB format not supported in WebGPU\";\n case Constants.TEXTUREFORMAT_RGBA:\n return \"rgba16float\" /* WebGPUConstants.TextureFormat.RGBA16Float */;\n default:\n return \"rgba16float\" /* WebGPUConstants.TextureFormat.RGBA16Float */;\n }\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:\n // eslint-disable-next-line no-throw-literal\n throw \"TEXTURETYPE_UNSIGNED_SHORT_5_6_5 format not supported in WebGPU\";\n case Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:\n switch (format) {\n case Constants.TEXTUREFORMAT_RGBA:\n return \"rg11b10ufloat\" /* WebGPUConstants.TextureFormat.RG11B10UFloat */;\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\n // eslint-disable-next-line no-throw-literal\n throw \"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV\";\n default:\n return \"rg11b10ufloat\" /* WebGPUConstants.TextureFormat.RG11B10UFloat */;\n }\n case Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:\n switch (format) {\n case Constants.TEXTUREFORMAT_RGBA:\n return \"rgb9e5ufloat\" /* WebGPUConstants.TextureFormat.RGB9E5UFloat */;\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\n // eslint-disable-next-line no-throw-literal\n throw \"TEXTUREFORMAT_RGBA_INTEGER format not supported in WebGPU when type is TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV\";\n default:\n return \"rgb9e5ufloat\" /* WebGPUConstants.TextureFormat.RGB9E5UFloat */;\n }\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:\n // eslint-disable-next-line no-throw-literal\n throw \"TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 format not supported in WebGPU\";\n case Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:\n // eslint-disable-next-line no-throw-literal\n throw \"TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 format not supported in WebGPU\";\n case Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:\n switch (format) {\n case Constants.TEXTUREFORMAT_RGBA:\n return \"rgb10a2unorm\" /* WebGPUConstants.TextureFormat.RGB10A2Unorm */;\n case Constants.TEXTUREFORMAT_RGBA_INTEGER:\n return \"rgb10a2uint\" /* WebGPUConstants.TextureFormat.RGB10A2UINT */;\n default:\n return \"rgb10a2unorm\" /* WebGPUConstants.TextureFormat.RGB10A2Unorm */;\n }\n }\n return useSRGBBuffer ? \"rgba8unorm-srgb\" /* WebGPUConstants.TextureFormat.RGBA8UnormSRGB */ : \"rgba8unorm\" /* WebGPUConstants.TextureFormat.RGBA8Unorm */;\n }\n static GetNumChannelsFromWebGPUTextureFormat(format) {\n switch (format) {\n case \"r8unorm\" /* WebGPUConstants.TextureFormat.R8Unorm */:\n case \"r8snorm\" /* WebGPUConstants.TextureFormat.R8Snorm */:\n case \"r8uint\" /* WebGPUConstants.TextureFormat.R8Uint */:\n case \"r8sint\" /* WebGPUConstants.TextureFormat.R8Sint */:\n case \"bc4-r-unorm\" /* WebGPUConstants.TextureFormat.BC4RUnorm */:\n case \"bc4-r-snorm\" /* WebGPUConstants.TextureFormat.BC4RSnorm */:\n case \"r16uint\" /* WebGPUConstants.TextureFormat.R16Uint */:\n case \"r16sint\" /* WebGPUConstants.TextureFormat.R16Sint */:\n case \"depth16unorm\" /* WebGPUConstants.TextureFormat.Depth16Unorm */:\n case \"r16float\" /* WebGPUConstants.TextureFormat.R16Float */:\n case \"r16unorm\" /* WebGPUConstants.TextureFormat.R16Unorm */:\n case \"r16snorm\" /* WebGPUConstants.TextureFormat.R16Snorm */:\n case \"r32uint\" /* WebGPUConstants.TextureFormat.R32Uint */:\n case \"r32sint\" /* WebGPUConstants.TextureFormat.R32Sint */:\n case \"r32float\" /* WebGPUConstants.TextureFormat.R32Float */:\n case \"depth32float\" /* WebGPUConstants.TextureFormat.Depth32Float */:\n case \"stencil8\" /* WebGPUConstants.TextureFormat.Stencil8 */:\n case \"depth24plus\" /* WebGPUConstants.TextureFormat.Depth24Plus */:\n case \"eac-r11unorm\" /* WebGPUConstants.TextureFormat.EACR11Unorm */:\n case \"eac-r11snorm\" /* WebGPUConstants.TextureFormat.EACR11Snorm */:\n return 1;\n case \"rg8unorm\" /* WebGPUConstants.TextureFormat.RG8Unorm */:\n case \"rg8snorm\" /* WebGPUConstants.TextureFormat.RG8Snorm */:\n case \"rg8uint\" /* WebGPUConstants.TextureFormat.RG8Uint */:\n case \"rg8sint\" /* WebGPUConstants.TextureFormat.RG8Sint */:\n case \"depth32float-stencil8\" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:\n case \"bc5-rg-unorm\" /* WebGPUConstants.TextureFormat.BC5RGUnorm */:\n case \"bc5-rg-snorm\" /* WebGPUConstants.TextureFormat.BC5RGSnorm */:\n case \"rg16uint\" /* WebGPUConstants.TextureFormat.RG16Uint */:\n case \"rg16sint\" /* WebGPUConstants.TextureFormat.RG16Sint */:\n case \"rg16float\" /* WebGPUConstants.TextureFormat.RG16Float */:\n case \"rg16unorm\" /* WebGPUConstants.TextureFormat.RG16Unorm */:\n case \"rg16snorm\" /* WebGPUConstants.TextureFormat.RG16Snorm */:\n case \"rg32uint\" /* WebGPUConstants.TextureFormat.RG32Uint */:\n case \"rg32sint\" /* WebGPUConstants.TextureFormat.RG32Sint */:\n case \"rg32float\" /* WebGPUConstants.TextureFormat.RG32Float */:\n case \"depth24plus-stencil8\" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:\n case \"eac-rg11unorm\" /* WebGPUConstants.TextureFormat.EACRG11Unorm */:\n case \"eac-rg11snorm\" /* WebGPUConstants.TextureFormat.EACRG11Snorm */:\n return 2;\n case \"rgb9e5ufloat\" /* WebGPUConstants.TextureFormat.RGB9E5UFloat */:\n case \"rg11b10ufloat\" /* WebGPUConstants.TextureFormat.RG11B10UFloat */:\n case \"bc6h-rgb-ufloat\" /* WebGPUConstants.TextureFormat.BC6HRGBUFloat */:\n case \"bc6h-rgb-float\" /* WebGPUConstants.TextureFormat.BC6HRGBFloat */:\n case \"etc2-rgb8unorm\" /* WebGPUConstants.TextureFormat.ETC2RGB8Unorm */:\n case \"etc2-rgb8unorm-srgb\" /* WebGPUConstants.TextureFormat.ETC2RGB8UnormSRGB */:\n return 3;\n case \"rgba8unorm\" /* WebGPUConstants.TextureFormat.RGBA8Unorm */:\n case \"rgba8unorm-srgb\" /* WebGPUConstants.TextureFormat.RGBA8UnormSRGB */:\n case \"rgba8snorm\" /* WebGPUConstants.TextureFormat.RGBA8Snorm */:\n case \"rgba8uint\" /* WebGPUConstants.TextureFormat.RGBA8Uint */:\n case \"rgba8sint\" /* WebGPUConstants.TextureFormat.RGBA8Sint */:\n case \"bgra8unorm\" /* WebGPUConstants.TextureFormat.BGRA8Unorm */:\n case \"bgra8unorm-srgb\" /* WebGPUConstants.TextureFormat.BGRA8UnormSRGB */:\n case \"rgba16unorm\" /* WebGPUConstants.TextureFormat.RGBA16Unorm */:\n case \"rgba16snorm\" /* WebGPUConstants.TextureFormat.RGBA16Snorm */:\n case \"rgb10a2uint\" /* WebGPUConstants.TextureFormat.RGB10A2UINT */:\n case \"rgb10a2unorm\" /* WebGPUConstants.TextureFormat.RGB10A2Unorm */:\n case \"bc7-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC7RGBAUnorm */:\n case \"bc7-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC7RGBAUnormSRGB */:\n case \"bc3-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC3RGBAUnorm */:\n case \"bc3-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC3RGBAUnormSRGB */:\n case \"bc2-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC2RGBAUnorm */:\n case \"bc2-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC2RGBAUnormSRGB */:\n case \"bc1-rgba-unorm\" /* WebGPUConstants.TextureFormat.BC1RGBAUnorm */:\n case \"bc1-rgba-unorm-srgb\" /* WebGPUConstants.TextureFormat.BC1RGBAUnormSRGB */:\n case \"rgba16uint\" /* WebGPUConstants.TextureFormat.RGBA16Uint */:\n case \"rgba16sint\" /* WebGPUConstants.TextureFormat.RGBA16Sint */:\n case \"rgba16float\" /* WebGPUConstants.TextureFormat.RGBA16Float */:\n case \"rgba32uint\" /* WebGPUConstants.TextureFormat.RGBA32Uint */:\n case \"rgba32sint\" /* WebGPUConstants.TextureFormat.RGBA32Sint */:\n case \"rgba32float\" /* WebGPUConstants.TextureFormat.RGBA32Float */:\n case \"etc2-rgb8a1unorm\" /* WebGPUConstants.TextureFormat.ETC2RGB8A1Unorm */:\n case \"etc2-rgb8a1unorm-srgb\" /* WebGPUConstants.TextureFormat.ETC2RGB8A1UnormSRGB */:\n case \"etc2-rgba8unorm\" /* WebGPUConstants.TextureFormat.ETC2RGBA8Unorm */:\n case \"etc2-rgba8unorm-srgb\" /* WebGPUConstants.TextureFormat.ETC2RGBA8UnormSRGB */:\n case \"astc-4x4-unorm\" /* WebGPUConstants.TextureFormat.ASTC4x4Unorm */:\n case \"astc-4x4-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC4x4UnormSRGB */:\n case \"astc-5x4-unorm\" /* WebGPUConstants.TextureFormat.ASTC5x4Unorm */:\n case \"astc-5x4-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC5x4UnormSRGB */:\n case \"astc-5x5-unorm\" /* WebGPUConstants.TextureFormat.ASTC5x5Unorm */:\n case \"astc-5x5-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC5x5UnormSRGB */:\n case \"astc-6x5-unorm\" /* WebGPUConstants.TextureFormat.ASTC6x5Unorm */:\n case \"astc-6x5-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC6x5UnormSRGB */:\n case \"astc-6x6-unorm\" /* WebGPUConstants.TextureFormat.ASTC6x6Unorm */:\n case \"astc-6x6-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC6x6UnormSRGB */:\n case \"astc-8x5-unorm\" /* WebGPUConstants.TextureFormat.ASTC8x5Unorm */:\n case \"astc-8x5-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC8x5UnormSRGB */:\n case \"astc-8x6-unorm\" /* WebGPUConstants.TextureFormat.ASTC8x6Unorm */:\n case \"astc-8x6-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC8x6UnormSRGB */:\n case \"astc-8x8-unorm\" /* WebGPUConstants.TextureFormat.ASTC8x8Unorm */:\n case \"astc-8x8-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC8x8UnormSRGB */:\n case \"astc-10x5-unorm\" /* WebGPUConstants.TextureFormat.ASTC10x5Unorm */:\n case \"astc-10x5-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC10x5UnormSRGB */:\n case \"astc-10x6-unorm\" /* WebGPUConstants.TextureFormat.ASTC10x6Unorm */:\n case \"astc-10x6-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC10x6UnormSRGB */:\n case \"astc-10x8-unorm\" /* WebGPUConstants.TextureFormat.ASTC10x8Unorm */:\n case \"astc-10x8-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC10x8UnormSRGB */:\n case \"astc-10x10-unorm\" /* WebGPUConstants.TextureFormat.ASTC10x10Unorm */:\n case \"astc-10x10-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC10x10UnormSRGB */:\n case \"astc-12x10-unorm\" /* WebGPUConstants.TextureFormat.ASTC12x10Unorm */:\n case \"astc-12x10-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC12x10UnormSRGB */:\n case \"astc-12x12-unorm\" /* WebGPUConstants.TextureFormat.ASTC12x12Unorm */:\n case \"astc-12x12-unorm-srgb\" /* WebGPUConstants.TextureFormat.ASTC12x12UnormSRGB */:\n return 4;\n }\n // eslint-disable-next-line no-throw-literal\n throw `Unknown format ${format}!`;\n }\n static HasStencilAspect(format) {\n switch (format) {\n case \"stencil8\" /* WebGPUConstants.TextureFormat.Stencil8 */:\n case \"depth32float-stencil8\" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:\n case \"depth24plus-stencil8\" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:\n return true;\n }\n return false;\n }\n static HasDepthAndStencilAspects(format) {\n switch (format) {\n case \"depth32float-stencil8\" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:\n case \"depth24plus-stencil8\" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:\n return true;\n }\n return false;\n }\n static GetDepthFormatOnly(format) {\n switch (format) {\n case \"depth16unorm\" /* WebGPUConstants.TextureFormat.Depth16Unorm */:\n return \"depth16unorm\" /* WebGPUConstants.TextureFormat.Depth16Unorm */;\n case \"depth24plus\" /* WebGPUConstants.TextureFormat.Depth24Plus */:\n return \"depth24plus\" /* WebGPUConstants.TextureFormat.Depth24Plus */;\n case \"depth24plus-stencil8\" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */:\n return \"depth24plus\" /* WebGPUConstants.TextureFormat.Depth24Plus */;\n case \"depth32float\" /* WebGPUConstants.TextureFormat.Depth32Float */:\n return \"depth32float\" /* WebGPUConstants.TextureFormat.Depth32Float */;\n case \"depth32float-stencil8\" /* WebGPUConstants.TextureFormat.Depth32FloatStencil8 */:\n return \"depth32float\" /* WebGPUConstants.TextureFormat.Depth32Float */;\n }\n return format;\n }\n static GetSample(sampleCount) {\n // WebGPU only supports 1 or 4\n return sampleCount > 1 ? 4 : 1;\n }\n}\n//# sourceMappingURL=webgpuTextureHelper.js.map","import { PerfCounter } from \"../../Misc/perfCounter\";\n/**\n * Class used to define a WebGPU performance counter\n */\nexport class WebGPUPerfCounter {\n constructor() {\n this._gpuTimeInFrameId = -1;\n /**\n * The GPU time in nanoseconds spent in the last frame\n */\n this.counter = new PerfCounter();\n }\n /**\n * @internal\n */\n _addDuration(currentFrameId, duration) {\n if (currentFrameId < this._gpuTimeInFrameId) {\n return;\n }\n if (this._gpuTimeInFrameId !== currentFrameId) {\n this.counter._fetchResult();\n this.counter.fetchNewFrame();\n this.counter.addCount(duration, false);\n this._gpuTimeInFrameId = currentFrameId;\n }\n else {\n this.counter.addCount(duration, false);\n }\n }\n}\n//# sourceMappingURL=webgpuPerfCounter.js.map","import { AbstractEngine } from \"./abstractEngine\";\nimport { Logger } from \"core/Misc/logger\";\nimport { WebGPUTextureHelper } from \"./WebGPU/webgpuTextureHelper\";\nimport { WebGPUPerfCounter } from \"./WebGPU/webgpuPerfCounter\";\nimport { Constants } from \"./constants\";\n/**\n * The base engine class for WebGPU\n */\nexport class ThinWebGPUEngine extends AbstractEngine {\n constructor() {\n super(...arguments);\n // TODO WEBGPU remove those variables when code stabilized\n /** @internal */\n this.dbgShowShaderCode = false;\n /** @internal */\n this.dbgSanityChecks = true;\n /** @internal */\n this.dbgVerboseLogsNumFrames = 10;\n /** @internal */\n this.dbgLogIfNotDrawWrapper = true;\n /** @internal */\n this.dbgShowEmptyEnableEffectCalls = true;\n /** @internal */\n this.dbgVerboseLogsForFirstFrames = false;\n /** @internal */\n this._currentRenderPass = null;\n this._snapshotRenderingMode = Constants.SNAPSHOTRENDERING_STANDARD;\n /** @internal */\n this._timestampIndex = 0;\n /** @internal */\n this._debugStackRenderPass = [];\n }\n /**\n * Enables or disables GPU timing measurements.\n * Note that this is only supported if the \"timestamp-query\" extension is enabled in the options.\n */\n get enableGPUTimingMeasurements() {\n return this._timestampQuery.enable;\n }\n set enableGPUTimingMeasurements(enable) {\n if (this._timestampQuery.enable === enable) {\n return;\n }\n this.gpuTimeInFrameForMainPass = enable ? new WebGPUPerfCounter() : undefined;\n this._timestampQuery.enable = enable;\n }\n _currentPassIsMainPass() {\n return this._currentRenderTarget === null;\n }\n /** @internal */\n _endCurrentRenderPass() {\n if (!this._currentRenderPass) {\n return 0;\n }\n if (this._debugStackRenderPass.length !== 0) {\n for (let i = 0; i < this._debugStackRenderPass.length; ++i) {\n this._currentRenderPass.popDebugGroup();\n }\n }\n const currentPassIndex = this._currentPassIsMainPass() ? 2 : 1;\n if (!this._snapshotRendering.endRenderPass(this._currentRenderPass) && !this.compatibilityMode) {\n this._bundleList.run(this._currentRenderPass);\n this._bundleList.reset();\n }\n this._currentRenderPass.end();\n this._timestampQuery.endPass(this._timestampIndex, (this._currentRenderTarget && this._currentRenderTarget.gpuTimeInFrame\n ? this._currentRenderTarget.gpuTimeInFrame\n : this.gpuTimeInFrameForMainPass));\n this._timestampIndex += 2;\n if (this.dbgVerboseLogsForFirstFrames) {\n if (this._count === undefined) {\n this._count = 0;\n }\n if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {\n Logger.Log(\"frame #\" +\n this._count +\n \" - \" +\n (currentPassIndex === 2 ? \"main\" : \"render target\") +\n \" end pass\" +\n (currentPassIndex === 1 ? \" - internalTexture.uniqueId=\" + this._currentRenderTarget?.texture?.uniqueId : \"\"));\n }\n }\n this._debugPopGroup?.(0);\n this._currentRenderPass = null;\n return currentPassIndex;\n }\n /**\n * @internal\n */\n _generateMipmaps(texture, commandEncoder) {\n commandEncoder = commandEncoder ?? this._renderEncoder;\n const gpuHardwareTexture = texture._hardwareTexture;\n if (!gpuHardwareTexture) {\n return;\n }\n if (commandEncoder === this._renderEncoder) {\n // We must close the current pass (if any) because we are going to use the render encoder to generate the mipmaps (so, we are going to create a new render pass)\n this._endCurrentRenderPass();\n }\n const format = texture._hardwareTexture.format;\n const mipmapCount = WebGPUTextureHelper.ComputeNumMipmapLevels(texture.width, texture.height);\n if (this.dbgVerboseLogsForFirstFrames) {\n if (this._count === undefined) {\n this._count = 0;\n }\n if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {\n Logger.Log(\"frame #\" +\n this._count +\n \" - generate mipmaps - width=\" +\n texture.width +\n \", height=\" +\n texture.height +\n \", isCube=\" +\n texture.isCube +\n \", command encoder=\" +\n (commandEncoder === this._renderEncoder ? \"render\" : \"copy\"));\n }\n }\n if (texture.isCube) {\n this._textureHelper.generateCubeMipmaps(gpuHardwareTexture, format, mipmapCount, commandEncoder);\n }\n else {\n this._textureHelper.generateMipmaps(gpuHardwareTexture, format, mipmapCount, 0, texture.is3D, commandEncoder);\n }\n }\n}\n//# sourceMappingURL=thinWebGPUEngine.js.map","/** @internal */\n// eslint-disable-next-line import/export\nexport var PowerPreference;\n(function (PowerPreference) {\n PowerPreference[\"LowPower\"] = \"low-power\";\n PowerPreference[\"HighPerformance\"] = \"high-performance\";\n})(PowerPreference || (PowerPreference = {}));\n/** @internal */\nexport var FeatureName;\n(function (FeatureName) {\n FeatureName[\"DepthClipControl\"] = \"depth-clip-control\";\n FeatureName[\"Depth32FloatStencil8\"] = \"depth32float-stencil8\";\n FeatureName[\"TextureCompressionBC\"] = \"texture-compression-bc\";\n FeatureName[\"TextureCompressionBCSliced3D\"] = \"texture-compression-bc-sliced-3d\";\n FeatureName[\"TextureCompressionETC2\"] = \"texture-compression-etc2\";\n FeatureName[\"TextureCompressionASTC\"] = \"texture-compression-astc\";\n FeatureName[\"TextureCompressionASTCSliced3D\"] = \"texture-compression-astc-sliced-3d\";\n FeatureName[\"TimestampQuery\"] = \"timestamp-query\";\n FeatureName[\"IndirectFirstInstance\"] = \"indirect-first-instance\";\n FeatureName[\"ShaderF16\"] = \"shader-f16\";\n FeatureName[\"RG11B10UFloatRenderable\"] = \"rg11b10ufloat-renderable\";\n FeatureName[\"BGRA8UnormStorage\"] = \"bgra8unorm-storage\";\n FeatureName[\"Float32Filterable\"] = \"float32-filterable\";\n FeatureName[\"Float32Blendable\"] = \"float32-blendable\";\n FeatureName[\"ClipDistances\"] = \"clip-distances\";\n FeatureName[\"DualSourceBlending\"] = \"dual-source-blending\";\n})(FeatureName || (FeatureName = {}));\n/** @internal */\nexport var BufferMapState;\n(function (BufferMapState) {\n BufferMapState[\"Unmapped\"] = \"unmapped\";\n BufferMapState[\"Pending\"] = \"pending\";\n BufferMapState[\"Mapped\"] = \"mapped\";\n})(BufferMapState || (BufferMapState = {}));\n/** @internal */\nexport var BufferUsage;\n(function (BufferUsage) {\n BufferUsage[BufferUsage[\"MapRead\"] = 1] = \"MapRead\";\n BufferUsage[BufferUsage[\"MapWrite\"] = 2] = \"MapWrite\";\n BufferUsage[BufferUsage[\"CopySrc\"] = 4] = \"CopySrc\";\n BufferUsage[BufferUsage[\"CopyDst\"] = 8] = \"CopyDst\";\n BufferUsage[BufferUsage[\"Index\"] = 16] = \"Index\";\n BufferUsage[BufferUsage[\"Vertex\"] = 32] = \"Vertex\";\n BufferUsage[BufferUsage[\"Uniform\"] = 64] = \"Uniform\";\n BufferUsage[BufferUsage[\"Storage\"] = 128] = \"Storage\";\n BufferUsage[BufferUsage[\"Indirect\"] = 256] = \"Indirect\";\n BufferUsage[BufferUsage[\"QueryResolve\"] = 512] = \"QueryResolve\";\n})(BufferUsage || (BufferUsage = {}));\n/** @internal */\nexport var MapMode;\n(function (MapMode) {\n MapMode[MapMode[\"Read\"] = 1] = \"Read\";\n MapMode[MapMode[\"Write\"] = 2] = \"Write\";\n})(MapMode || (MapMode = {}));\n/** @internal */\nexport var TextureDimension;\n(function (TextureDimension) {\n TextureDimension[\"E1d\"] = \"1d\";\n TextureDimension[\"E2d\"] = \"2d\";\n TextureDimension[\"E3d\"] = \"3d\";\n})(TextureDimension || (TextureDimension = {}));\n/** @internal */\nexport var TextureUsage;\n(function (TextureUsage) {\n TextureUsage[TextureUsage[\"CopySrc\"] = 1] = \"CopySrc\";\n TextureUsage[TextureUsage[\"CopyDst\"] = 2] = \"CopyDst\";\n TextureUsage[TextureUsage[\"TextureBinding\"] = 4] = \"TextureBinding\";\n TextureUsage[TextureUsage[\"StorageBinding\"] = 8] = \"StorageBinding\";\n TextureUsage[TextureUsage[\"RenderAttachment\"] = 16] = \"RenderAttachment\";\n})(TextureUsage || (TextureUsage = {}));\n/** @internal */\nexport var TextureViewDimension;\n(function (TextureViewDimension) {\n TextureViewDimension[\"E1d\"] = \"1d\";\n TextureViewDimension[\"E2d\"] = \"2d\";\n TextureViewDimension[\"E2dArray\"] = \"2d-array\";\n TextureViewDimension[\"Cube\"] = \"cube\";\n TextureViewDimension[\"CubeArray\"] = \"cube-array\";\n TextureViewDimension[\"E3d\"] = \"3d\";\n})(TextureViewDimension || (TextureViewDimension = {}));\n/** @internal */\nexport var TextureAspect;\n(function (TextureAspect) {\n TextureAspect[\"All\"] = \"all\";\n TextureAspect[\"StencilOnly\"] = \"stencil-only\";\n TextureAspect[\"DepthOnly\"] = \"depth-only\";\n})(TextureAspect || (TextureAspect = {}));\n/**\n * Comments taken from https://github.com/gfx-rs/wgpu/blob/master/wgpu-types/src/lib.rs\n * @internal\n */\nexport var TextureFormat;\n(function (TextureFormat) {\n // 8-bit formats\n TextureFormat[\"R8Unorm\"] = \"r8unorm\";\n TextureFormat[\"R8Snorm\"] = \"r8snorm\";\n TextureFormat[\"R8Uint\"] = \"r8uint\";\n TextureFormat[\"R8Sint\"] = \"r8sint\";\n // 16-bit formats\n TextureFormat[\"R16Uint\"] = \"r16uint\";\n TextureFormat[\"R16Sint\"] = \"r16sint\";\n TextureFormat[\"R16Float\"] = \"r16float\";\n TextureFormat[\"RG8Unorm\"] = \"rg8unorm\";\n TextureFormat[\"RG8Snorm\"] = \"rg8snorm\";\n TextureFormat[\"RG8Uint\"] = \"rg8uint\";\n TextureFormat[\"RG8Sint\"] = \"rg8sint\";\n TextureFormat[\"R16Unorm\"] = \"r16unorm\";\n TextureFormat[\"R16Snorm\"] = \"r16snorm\";\n TextureFormat[\"RG16Unorm\"] = \"rg16unorm\";\n TextureFormat[\"RG16Snorm\"] = \"rg16snorm\";\n TextureFormat[\"RGBA16Unorm\"] = \"rgba16unorm\";\n TextureFormat[\"RGBA16Snorm\"] = \"rgba16snorm\";\n // 32-bit formats\n TextureFormat[\"R32Uint\"] = \"r32uint\";\n TextureFormat[\"R32Sint\"] = \"r32sint\";\n TextureFormat[\"R32Float\"] = \"r32float\";\n TextureFormat[\"RG16Uint\"] = \"rg16uint\";\n TextureFormat[\"RG16Sint\"] = \"rg16sint\";\n TextureFormat[\"RG16Float\"] = \"rg16float\";\n TextureFormat[\"RGBA8Unorm\"] = \"rgba8unorm\";\n TextureFormat[\"RGBA8UnormSRGB\"] = \"rgba8unorm-srgb\";\n TextureFormat[\"RGBA8Snorm\"] = \"rgba8snorm\";\n TextureFormat[\"RGBA8Uint\"] = \"rgba8uint\";\n TextureFormat[\"RGBA8Sint\"] = \"rgba8sint\";\n TextureFormat[\"BGRA8Unorm\"] = \"bgra8unorm\";\n TextureFormat[\"BGRA8UnormSRGB\"] = \"bgra8unorm-srgb\";\n // Packed 32-bit formats\n TextureFormat[\"RGB9E5UFloat\"] = \"rgb9e5ufloat\";\n TextureFormat[\"RGB10A2UINT\"] = \"rgb10a2uint\";\n TextureFormat[\"RGB10A2Unorm\"] = \"rgb10a2unorm\";\n TextureFormat[\"RG11B10UFloat\"] = \"rg11b10ufloat\";\n // 64-bit formats\n TextureFormat[\"RG32Uint\"] = \"rg32uint\";\n TextureFormat[\"RG32Sint\"] = \"rg32sint\";\n TextureFormat[\"RG32Float\"] = \"rg32float\";\n TextureFormat[\"RGBA16Uint\"] = \"rgba16uint\";\n TextureFormat[\"RGBA16Sint\"] = \"rgba16sint\";\n TextureFormat[\"RGBA16Float\"] = \"rgba16float\";\n // 128-bit formats\n TextureFormat[\"RGBA32Uint\"] = \"rgba32uint\";\n TextureFormat[\"RGBA32Sint\"] = \"rgba32sint\";\n TextureFormat[\"RGBA32Float\"] = \"rgba32float\";\n // Depth and stencil formats\n TextureFormat[\"Stencil8\"] = \"stencil8\";\n TextureFormat[\"Depth16Unorm\"] = \"depth16unorm\";\n TextureFormat[\"Depth24Plus\"] = \"depth24plus\";\n TextureFormat[\"Depth24PlusStencil8\"] = \"depth24plus-stencil8\";\n TextureFormat[\"Depth32Float\"] = \"depth32float\";\n // BC compressed formats usable if \"texture-compression-bc\" is both\n // supported by the device/user agent and enabled in requestDevice.\n TextureFormat[\"BC1RGBAUnorm\"] = \"bc1-rgba-unorm\";\n TextureFormat[\"BC1RGBAUnormSRGB\"] = \"bc1-rgba-unorm-srgb\";\n TextureFormat[\"BC2RGBAUnorm\"] = \"bc2-rgba-unorm\";\n TextureFormat[\"BC2RGBAUnormSRGB\"] = \"bc2-rgba-unorm-srgb\";\n TextureFormat[\"BC3RGBAUnorm\"] = \"bc3-rgba-unorm\";\n TextureFormat[\"BC3RGBAUnormSRGB\"] = \"bc3-rgba-unorm-srgb\";\n TextureFormat[\"BC4RUnorm\"] = \"bc4-r-unorm\";\n TextureFormat[\"BC4RSnorm\"] = \"bc4-r-snorm\";\n TextureFormat[\"BC5RGUnorm\"] = \"bc5-rg-unorm\";\n TextureFormat[\"BC5RGSnorm\"] = \"bc5-rg-snorm\";\n TextureFormat[\"BC6HRGBUFloat\"] = \"bc6h-rgb-ufloat\";\n TextureFormat[\"BC6HRGBFloat\"] = \"bc6h-rgb-float\";\n TextureFormat[\"BC7RGBAUnorm\"] = \"bc7-rgba-unorm\";\n TextureFormat[\"BC7RGBAUnormSRGB\"] = \"bc7-rgba-unorm-srgb\";\n // ETC2 compressed formats usable if \"texture-compression-etc2\" is both\n // supported by the device/user agent and enabled in requestDevice.\n TextureFormat[\"ETC2RGB8Unorm\"] = \"etc2-rgb8unorm\";\n TextureFormat[\"ETC2RGB8UnormSRGB\"] = \"etc2-rgb8unorm-srgb\";\n TextureFormat[\"ETC2RGB8A1Unorm\"] = \"etc2-rgb8a1unorm\";\n TextureFormat[\"ETC2RGB8A1UnormSRGB\"] = \"etc2-rgb8a1unorm-srgb\";\n TextureFormat[\"ETC2RGBA8Unorm\"] = \"etc2-rgba8unorm\";\n TextureFormat[\"ETC2RGBA8UnormSRGB\"] = \"etc2-rgba8unorm-srgb\";\n TextureFormat[\"EACR11Unorm\"] = \"eac-r11unorm\";\n TextureFormat[\"EACR11Snorm\"] = \"eac-r11snorm\";\n TextureFormat[\"EACRG11Unorm\"] = \"eac-rg11unorm\";\n TextureFormat[\"EACRG11Snorm\"] = \"eac-rg11snorm\";\n // ASTC compressed formats usable if \"texture-compression-astc\" is both\n // supported by the device/user agent and enabled in requestDevice.\n TextureFormat[\"ASTC4x4Unorm\"] = \"astc-4x4-unorm\";\n TextureFormat[\"ASTC4x4UnormSRGB\"] = \"astc-4x4-unorm-srgb\";\n TextureFormat[\"ASTC5x4Unorm\"] = \"astc-5x4-unorm\";\n TextureFormat[\"ASTC5x4UnormSRGB\"] = \"astc-5x4-unorm-srgb\";\n TextureFormat[\"ASTC5x5Unorm\"] = \"astc-5x5-unorm\";\n TextureFormat[\"ASTC5x5UnormSRGB\"] = \"astc-5x5-unorm-srgb\";\n TextureFormat[\"ASTC6x5Unorm\"] = \"astc-6x5-unorm\";\n TextureFormat[\"ASTC6x5UnormSRGB\"] = \"astc-6x5-unorm-srgb\";\n TextureFormat[\"ASTC6x6Unorm\"] = \"astc-6x6-unorm\";\n TextureFormat[\"ASTC6x6UnormSRGB\"] = \"astc-6x6-unorm-srgb\";\n TextureFormat[\"ASTC8x5Unorm\"] = \"astc-8x5-unorm\";\n TextureFormat[\"ASTC8x5UnormSRGB\"] = \"astc-8x5-unorm-srgb\";\n TextureFormat[\"ASTC8x6Unorm\"] = \"astc-8x6-unorm\";\n TextureFormat[\"ASTC8x6UnormSRGB\"] = \"astc-8x6-unorm-srgb\";\n TextureFormat[\"ASTC8x8Unorm\"] = \"astc-8x8-unorm\";\n TextureFormat[\"ASTC8x8UnormSRGB\"] = \"astc-8x8-unorm-srgb\";\n TextureFormat[\"ASTC10x5Unorm\"] = \"astc-10x5-unorm\";\n TextureFormat[\"ASTC10x5UnormSRGB\"] = \"astc-10x5-unorm-srgb\";\n TextureFormat[\"ASTC10x6Unorm\"] = \"astc-10x6-unorm\";\n TextureFormat[\"ASTC10x6UnormSRGB\"] = \"astc-10x6-unorm-srgb\";\n TextureFormat[\"ASTC10x8Unorm\"] = \"astc-10x8-unorm\";\n TextureFormat[\"ASTC10x8UnormSRGB\"] = \"astc-10x8-unorm-srgb\";\n TextureFormat[\"ASTC10x10Unorm\"] = \"astc-10x10-unorm\";\n TextureFormat[\"ASTC10x10UnormSRGB\"] = \"astc-10x10-unorm-srgb\";\n TextureFormat[\"ASTC12x10Unorm\"] = \"astc-12x10-unorm\";\n TextureFormat[\"ASTC12x10UnormSRGB\"] = \"astc-12x10-unorm-srgb\";\n TextureFormat[\"ASTC12x12Unorm\"] = \"astc-12x12-unorm\";\n TextureFormat[\"ASTC12x12UnormSRGB\"] = \"astc-12x12-unorm-srgb\";\n // \"depth32float-stencil8\" feature\n TextureFormat[\"Depth32FloatStencil8\"] = \"depth32float-stencil8\";\n})(TextureFormat || (TextureFormat = {}));\n/** @internal */\nexport var AddressMode;\n(function (AddressMode) {\n AddressMode[\"ClampToEdge\"] = \"clamp-to-edge\";\n AddressMode[\"Repeat\"] = \"repeat\";\n AddressMode[\"MirrorRepeat\"] = \"mirror-repeat\";\n})(AddressMode || (AddressMode = {}));\n/** @internal */\nexport var FilterMode;\n(function (FilterMode) {\n FilterMode[\"Nearest\"] = \"nearest\";\n FilterMode[\"Linear\"] = \"linear\";\n})(FilterMode || (FilterMode = {}));\n/** @internal */\nexport var MipmapFilterMode;\n(function (MipmapFilterMode) {\n MipmapFilterMode[\"Nearest\"] = \"nearest\";\n MipmapFilterMode[\"Linear\"] = \"linear\";\n})(MipmapFilterMode || (MipmapFilterMode = {}));\n/** @internal */\nexport var CompareFunction;\n(function (CompareFunction) {\n CompareFunction[\"Never\"] = \"never\";\n CompareFunction[\"Less\"] = \"less\";\n CompareFunction[\"Equal\"] = \"equal\";\n CompareFunction[\"LessEqual\"] = \"less-equal\";\n CompareFunction[\"Greater\"] = \"greater\";\n CompareFunction[\"NotEqual\"] = \"not-equal\";\n CompareFunction[\"GreaterEqual\"] = \"greater-equal\";\n CompareFunction[\"Always\"] = \"always\";\n})(CompareFunction || (CompareFunction = {}));\n/** @internal */\nexport var ShaderStage;\n(function (ShaderStage) {\n ShaderStage[ShaderStage[\"Vertex\"] = 1] = \"Vertex\";\n ShaderStage[ShaderStage[\"Fragment\"] = 2] = \"Fragment\";\n ShaderStage[ShaderStage[\"Compute\"] = 4] = \"Compute\";\n})(ShaderStage || (ShaderStage = {}));\n/** @internal */\nexport var BufferBindingType;\n(function (BufferBindingType) {\n BufferBindingType[\"Uniform\"] = \"uniform\";\n BufferBindingType[\"Storage\"] = \"storage\";\n BufferBindingType[\"ReadOnlyStorage\"] = \"read-only-storage\";\n})(BufferBindingType || (BufferBindingType = {}));\n/** @internal */\nexport var SamplerBindingType;\n(function (SamplerBindingType) {\n SamplerBindingType[\"Filtering\"] = \"filtering\";\n SamplerBindingType[\"NonFiltering\"] = \"non-filtering\";\n SamplerBindingType[\"Comparison\"] = \"comparison\";\n})(SamplerBindingType || (SamplerBindingType = {}));\n/** @internal */\nexport var TextureSampleType;\n(function (TextureSampleType) {\n TextureSampleType[\"Float\"] = \"float\";\n TextureSampleType[\"UnfilterableFloat\"] = \"unfilterable-float\";\n TextureSampleType[\"Depth\"] = \"depth\";\n TextureSampleType[\"Sint\"] = \"sint\";\n TextureSampleType[\"Uint\"] = \"uint\";\n})(TextureSampleType || (TextureSampleType = {}));\n/** @internal */\nexport var StorageTextureAccess;\n(function (StorageTextureAccess) {\n StorageTextureAccess[\"WriteOnly\"] = \"write-only\";\n StorageTextureAccess[\"ReadOnly\"] = \"read-only\";\n StorageTextureAccess[\"ReadWrite\"] = \"read-write\";\n})(StorageTextureAccess || (StorageTextureAccess = {}));\n/** @internal */\nexport var CompilationMessageType;\n(function (CompilationMessageType) {\n CompilationMessageType[\"Error\"] = \"error\";\n CompilationMessageType[\"Warning\"] = \"warning\";\n CompilationMessageType[\"Info\"] = \"info\";\n})(CompilationMessageType || (CompilationMessageType = {}));\n/** @internal */\nexport var PipelineErrorReason;\n(function (PipelineErrorReason) {\n PipelineErrorReason[\"Validation\"] = \"validation\";\n PipelineErrorReason[\"Internal\"] = \"internal\";\n})(PipelineErrorReason || (PipelineErrorReason = {}));\n/** @internal */\nexport var AutoLayoutMode;\n(function (AutoLayoutMode) {\n AutoLayoutMode[\"Auto\"] = \"auto\";\n})(AutoLayoutMode || (AutoLayoutMode = {}));\n/** @internal */\nexport var PrimitiveTopology;\n(function (PrimitiveTopology) {\n PrimitiveTopology[\"PointList\"] = \"point-list\";\n PrimitiveTopology[\"LineList\"] = \"line-list\";\n PrimitiveTopology[\"LineStrip\"] = \"line-strip\";\n PrimitiveTopology[\"TriangleList\"] = \"triangle-list\";\n PrimitiveTopology[\"TriangleStrip\"] = \"triangle-strip\";\n})(PrimitiveTopology || (PrimitiveTopology = {}));\n/** @internal */\nexport var FrontFace;\n(function (FrontFace) {\n FrontFace[\"CCW\"] = \"ccw\";\n FrontFace[\"CW\"] = \"cw\";\n})(FrontFace || (FrontFace = {}));\n/** @internal */\nexport var CullMode;\n(function (CullMode) {\n CullMode[\"None\"] = \"none\";\n CullMode[\"Front\"] = \"front\";\n CullMode[\"Back\"] = \"back\";\n})(CullMode || (CullMode = {}));\n/** @internal */\nexport var ColorWrite;\n(function (ColorWrite) {\n ColorWrite[ColorWrite[\"Red\"] = 1] = \"Red\";\n ColorWrite[ColorWrite[\"Green\"] = 2] = \"Green\";\n ColorWrite[ColorWrite[\"Blue\"] = 4] = \"Blue\";\n ColorWrite[ColorWrite[\"Alpha\"] = 8] = \"Alpha\";\n ColorWrite[ColorWrite[\"All\"] = 15] = \"All\";\n})(ColorWrite || (ColorWrite = {}));\n/** @internal */\nexport var BlendFactor;\n(function (BlendFactor) {\n BlendFactor[\"Zero\"] = \"zero\";\n BlendFactor[\"One\"] = \"one\";\n BlendFactor[\"Src\"] = \"src\";\n BlendFactor[\"OneMinusSrc\"] = \"one-minus-src\";\n BlendFactor[\"SrcAlpha\"] = \"src-alpha\";\n BlendFactor[\"OneMinusSrcAlpha\"] = \"one-minus-src-alpha\";\n BlendFactor[\"Dst\"] = \"dst\";\n BlendFactor[\"OneMinusDst\"] = \"one-minus-dst\";\n BlendFactor[\"DstAlpha\"] = \"dst-alpha\";\n BlendFactor[\"OneMinusDstAlpha\"] = \"one-minus-dst-alpha\";\n BlendFactor[\"SrcAlphaSaturated\"] = \"src-alpha-saturated\";\n BlendFactor[\"Constant\"] = \"constant\";\n BlendFactor[\"OneMinusConstant\"] = \"one-minus-constant\";\n BlendFactor[\"Src1\"] = \"src1\";\n BlendFactor[\"OneMinusSrc1\"] = \"one-minus-src1\";\n BlendFactor[\"Src1Alpha\"] = \"src1-alpha\";\n BlendFactor[\"OneMinusSrc1Alpha\"] = \"one-minus-src1-alpha\";\n})(BlendFactor || (BlendFactor = {}));\n/** @internal */\nexport var BlendOperation;\n(function (BlendOperation) {\n BlendOperation[\"Add\"] = \"add\";\n BlendOperation[\"Subtract\"] = \"subtract\";\n BlendOperation[\"ReverseSubtract\"] = \"reverse-subtract\";\n BlendOperation[\"Min\"] = \"min\";\n BlendOperation[\"Max\"] = \"max\";\n})(BlendOperation || (BlendOperation = {}));\n/** @internal */\nexport var StencilOperation;\n(function (StencilOperation) {\n StencilOperation[\"Keep\"] = \"keep\";\n StencilOperation[\"Zero\"] = \"zero\";\n StencilOperation[\"Replace\"] = \"replace\";\n StencilOperation[\"Invert\"] = \"invert\";\n StencilOperation[\"IncrementClamp\"] = \"increment-clamp\";\n StencilOperation[\"DecrementClamp\"] = \"decrement-clamp\";\n StencilOperation[\"IncrementWrap\"] = \"increment-wrap\";\n StencilOperation[\"DecrementWrap\"] = \"decrement-wrap\";\n})(StencilOperation || (StencilOperation = {}));\n/** @internal */\nexport var IndexFormat;\n(function (IndexFormat) {\n IndexFormat[\"Uint16\"] = \"uint16\";\n IndexFormat[\"Uint32\"] = \"uint32\";\n})(IndexFormat || (IndexFormat = {}));\n/** @internal */\nexport var VertexFormat;\n(function (VertexFormat) {\n VertexFormat[\"Uint8x2\"] = \"uint8x2\";\n VertexFormat[\"Uint8x4\"] = \"uint8x4\";\n VertexFormat[\"Sint8x2\"] = \"sint8x2\";\n VertexFormat[\"Sint8x4\"] = \"sint8x4\";\n VertexFormat[\"Unorm8x2\"] = \"unorm8x2\";\n VertexFormat[\"Unorm8x4\"] = \"unorm8x4\";\n VertexFormat[\"Snorm8x2\"] = \"snorm8x2\";\n VertexFormat[\"Snorm8x4\"] = \"snorm8x4\";\n VertexFormat[\"Uint16x2\"] = \"uint16x2\";\n VertexFormat[\"Uint16x4\"] = \"uint16x4\";\n VertexFormat[\"Sint16x2\"] = \"sint16x2\";\n VertexFormat[\"Sint16x4\"] = \"sint16x4\";\n VertexFormat[\"Unorm16x2\"] = \"unorm16x2\";\n VertexFormat[\"Unorm16x4\"] = \"unorm16x4\";\n VertexFormat[\"Snorm16x2\"] = \"snorm16x2\";\n VertexFormat[\"Snorm16x4\"] = \"snorm16x4\";\n VertexFormat[\"Float16x2\"] = \"float16x2\";\n VertexFormat[\"Float16x4\"] = \"float16x4\";\n VertexFormat[\"Float32\"] = \"float32\";\n VertexFormat[\"Float32x2\"] = \"float32x2\";\n VertexFormat[\"Float32x3\"] = \"float32x3\";\n VertexFormat[\"Float32x4\"] = \"float32x4\";\n VertexFormat[\"Uint32\"] = \"uint32\";\n VertexFormat[\"Uint32x2\"] = \"uint32x2\";\n VertexFormat[\"Uint32x3\"] = \"uint32x3\";\n VertexFormat[\"Uint32x4\"] = \"uint32x4\";\n VertexFormat[\"Sint32\"] = \"sint32\";\n VertexFormat[\"Sint32x2\"] = \"sint32x2\";\n VertexFormat[\"Sint32x3\"] = \"sint32x3\";\n VertexFormat[\"Sint32x4\"] = \"sint32x4\";\n VertexFormat[\"UNORM10x10x10x2\"] = \"unorm10-10-10-2\";\n})(VertexFormat || (VertexFormat = {}));\n/** @internal */\nexport var VertexStepMode;\n(function (VertexStepMode) {\n VertexStepMode[\"Vertex\"] = \"vertex\";\n VertexStepMode[\"Instance\"] = \"instance\";\n})(VertexStepMode || (VertexStepMode = {}));\n/** @internal */\nexport var ComputePassTimestampLocation;\n(function (ComputePassTimestampLocation) {\n ComputePassTimestampLocation[\"Beginning\"] = \"beginning\";\n ComputePassTimestampLocation[\"End\"] = \"end\";\n})(ComputePassTimestampLocation || (ComputePassTimestampLocation = {}));\n/** @internal */\nexport var RenderPassTimestampLocation;\n(function (RenderPassTimestampLocation) {\n RenderPassTimestampLocation[\"Beginning\"] = \"beginning\";\n RenderPassTimestampLocation[\"End\"] = \"end\";\n})(RenderPassTimestampLocation || (RenderPassTimestampLocation = {}));\n/** @internal */\nexport var LoadOp;\n(function (LoadOp) {\n LoadOp[\"Load\"] = \"load\";\n LoadOp[\"Clear\"] = \"clear\";\n})(LoadOp || (LoadOp = {}));\n/** @internal */\nexport var StoreOp;\n(function (StoreOp) {\n StoreOp[\"Store\"] = \"store\";\n StoreOp[\"Discard\"] = \"discard\";\n})(StoreOp || (StoreOp = {}));\n/** @internal */\nexport var QueryType;\n(function (QueryType) {\n QueryType[\"Occlusion\"] = \"occlusion\";\n QueryType[\"Timestamp\"] = \"timestamp\";\n})(QueryType || (QueryType = {}));\n/** @internal */\nexport var CanvasAlphaMode;\n(function (CanvasAlphaMode) {\n CanvasAlphaMode[\"Opaque\"] = \"opaque\";\n CanvasAlphaMode[\"Premultiplied\"] = \"premultiplied\";\n})(CanvasAlphaMode || (CanvasAlphaMode = {}));\n/** @internal */\nexport var CanvasToneMappingMode;\n(function (CanvasToneMappingMode) {\n CanvasToneMappingMode[\"Standard\"] = \"standard\";\n CanvasToneMappingMode[\"Extended\"] = \"extended\";\n})(CanvasToneMappingMode || (CanvasToneMappingMode = {}));\n/** @internal */\nexport var DeviceLostReason;\n(function (DeviceLostReason) {\n DeviceLostReason[\"Unknown\"] = \"unknown\";\n DeviceLostReason[\"Destroyed\"] = \"destroyed\";\n})(DeviceLostReason || (DeviceLostReason = {}));\n/** @internal */\nexport var ErrorFilter;\n(function (ErrorFilter) {\n ErrorFilter[\"Validation\"] = \"validation\";\n ErrorFilter[\"OutOfMemory\"] = \"out-of-memory\";\n ErrorFilter[\"Internal\"] = \"internal\";\n})(ErrorFilter || (ErrorFilter = {}));\n//# sourceMappingURL=webgpuConstants.js.map","/** @internal */\nexport class WebGPUShaderProcessor {\n constructor() {\n this.shaderLanguage = 0 /* ShaderLanguage.GLSL */;\n }\n _addUniformToLeftOverUBO(name, uniformType, preProcessors) {\n let length = 0;\n [name, uniformType, length] = this._getArraySize(name, uniformType, preProcessors);\n for (let i = 0; i < this._webgpuProcessingContext.leftOverUniforms.length; i++) {\n if (this._webgpuProcessingContext.leftOverUniforms[i].name === name) {\n return;\n }\n }\n this._webgpuProcessingContext.leftOverUniforms.push({\n name,\n type: uniformType,\n length,\n });\n }\n _buildLeftOverUBO() {\n if (!this._webgpuProcessingContext.leftOverUniforms.length) {\n return \"\";\n }\n const name = WebGPUShaderProcessor.LeftOvertUBOName;\n let availableUBO = this._webgpuProcessingContext.availableBuffers[name];\n if (!availableUBO) {\n availableUBO = {\n binding: this._webgpuProcessingContext.getNextFreeUBOBinding(),\n };\n this._webgpuProcessingContext.availableBuffers[name] = availableUBO;\n this._addBufferBindingDescription(name, availableUBO, \"uniform\" /* WebGPUConstants.BufferBindingType.Uniform */, true);\n this._addBufferBindingDescription(name, availableUBO, \"uniform\" /* WebGPUConstants.BufferBindingType.Uniform */, false);\n }\n return this._generateLeftOverUBOCode(name, availableUBO);\n }\n _collectBindingNames() {\n // collect all the binding names for faster processing in WebGPUCacheBindGroup\n for (let i = 0; i < this._webgpuProcessingContext.bindGroupLayoutEntries.length; i++) {\n const setDefinition = this._webgpuProcessingContext.bindGroupLayoutEntries[i];\n if (setDefinition === undefined) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[i] = [];\n continue;\n }\n for (let j = 0; j < setDefinition.length; j++) {\n const entry = this._webgpuProcessingContext.bindGroupLayoutEntries[i][j];\n const name = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].name;\n const nameInArrayOfTexture = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].nameInArrayOfTexture;\n if (entry) {\n if (entry.texture || entry.externalTexture || entry.storageTexture) {\n this._webgpuProcessingContext.textureNames.push(nameInArrayOfTexture);\n }\n else if (entry.sampler) {\n this._webgpuProcessingContext.samplerNames.push(name);\n }\n else if (entry.buffer) {\n this._webgpuProcessingContext.bufferNames.push(name);\n }\n }\n }\n }\n }\n _preCreateBindGroupEntries() {\n const bindGroupEntries = this._webgpuProcessingContext.bindGroupEntries;\n for (let i = 0; i < this._webgpuProcessingContext.bindGroupLayoutEntries.length; i++) {\n const setDefinition = this._webgpuProcessingContext.bindGroupLayoutEntries[i];\n const entries = [];\n for (let j = 0; j < setDefinition.length; j++) {\n const entry = this._webgpuProcessingContext.bindGroupLayoutEntries[i][j];\n if (entry.sampler || entry.texture || entry.storageTexture || entry.externalTexture) {\n entries.push({\n binding: entry.binding,\n resource: undefined,\n });\n }\n else if (entry.buffer) {\n entries.push({\n binding: entry.binding,\n resource: {\n buffer: undefined,\n offset: 0,\n size: 0,\n },\n });\n }\n }\n bindGroupEntries[i] = entries;\n }\n }\n _addTextureBindingDescription(name, textureInfo, textureIndex, dimension, format, isVertex) {\n // eslint-disable-next-line prefer-const\n let { groupIndex, bindingIndex } = textureInfo.textures[textureIndex];\n if (!this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex]) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = [];\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex] = [];\n }\n if (!this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex]) {\n let len;\n if (dimension === null) {\n len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({\n binding: bindingIndex,\n visibility: 0,\n externalTexture: {},\n });\n }\n else if (format) {\n len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({\n binding: bindingIndex,\n visibility: 0,\n storageTexture: {\n access: \"write-only\" /* WebGPUConstants.StorageTextureAccess.WriteOnly */,\n format,\n viewDimension: dimension,\n },\n });\n }\n else {\n len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({\n binding: bindingIndex,\n visibility: 0,\n texture: {\n sampleType: textureInfo.sampleType,\n viewDimension: dimension,\n multisampled: false,\n },\n });\n }\n const textureName = textureInfo.isTextureArray ? name + textureIndex : name;\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name, index: len - 1, nameInArrayOfTexture: textureName };\n }\n bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index;\n if (isVertex) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 1 /* WebGPUConstants.ShaderStage.Vertex */;\n }\n else {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 2 /* WebGPUConstants.ShaderStage.Fragment */;\n }\n }\n _addSamplerBindingDescription(name, samplerInfo, isVertex) {\n // eslint-disable-next-line prefer-const\n let { groupIndex, bindingIndex } = samplerInfo.binding;\n if (!this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex]) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = [];\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex] = [];\n }\n if (!this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex]) {\n const len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({\n binding: bindingIndex,\n visibility: 0,\n sampler: {\n type: samplerInfo.type,\n },\n });\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name, index: len - 1 };\n }\n bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index;\n if (isVertex) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 1 /* WebGPUConstants.ShaderStage.Vertex */;\n }\n else {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 2 /* WebGPUConstants.ShaderStage.Fragment */;\n }\n }\n _addBufferBindingDescription(name, uniformBufferInfo, bufferType, isVertex) {\n // eslint-disable-next-line prefer-const\n let { groupIndex, bindingIndex } = uniformBufferInfo.binding;\n if (!this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex]) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex] = [];\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex] = [];\n }\n if (!this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex]) {\n const len = this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex].push({\n binding: bindingIndex,\n visibility: 0,\n buffer: {\n type: bufferType,\n },\n });\n this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex] = { name, index: len - 1 };\n }\n bindingIndex = this._webgpuProcessingContext.bindGroupLayoutEntryInfo[groupIndex][bindingIndex].index;\n if (isVertex) {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 1 /* WebGPUConstants.ShaderStage.Vertex */;\n }\n else {\n this._webgpuProcessingContext.bindGroupLayoutEntries[groupIndex][bindingIndex].visibility |= 2 /* WebGPUConstants.ShaderStage.Fragment */;\n }\n }\n}\nWebGPUShaderProcessor.LeftOvertUBOName = \"LeftOver\";\nWebGPUShaderProcessor.InternalsUBOName = \"Internals\";\nWebGPUShaderProcessor.UniformSizes = {\n // GLSL types\n bool: 1,\n int: 1,\n float: 1,\n vec2: 2,\n ivec2: 2,\n uvec2: 2,\n vec3: 3,\n ivec3: 3,\n uvec3: 3,\n vec4: 4,\n ivec4: 4,\n uvec4: 4,\n mat2: 4,\n mat3: 12,\n mat4: 16,\n // WGSL types\n i32: 1,\n u32: 1,\n f32: 1,\n mat2x2: 4,\n mat3x3: 12,\n mat4x4: 16,\n mat2x2f: 4,\n mat3x3f: 12,\n mat4x4f: 16,\n vec2i: 2,\n vec3i: 3,\n vec4i: 4,\n vec2u: 2,\n vec3u: 3,\n vec4u: 4,\n vec2f: 2,\n vec3f: 3,\n vec4f: 4,\n vec2h: 1,\n vec3h: 2,\n vec4h: 2,\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nWebGPUShaderProcessor._SamplerFunctionByWebGLSamplerType = {\n sampler2D: \"sampler2D\",\n sampler2DArray: \"sampler2DArray\",\n sampler2DShadow: \"sampler2DShadow\",\n sampler2DArrayShadow: \"sampler2DArrayShadow\",\n samplerCube: \"samplerCube\",\n sampler3D: \"sampler3D\",\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nWebGPUShaderProcessor._TextureTypeByWebGLSamplerType = {\n sampler2D: \"texture2D\",\n sampler2DArray: \"texture2DArray\",\n sampler2DShadow: \"texture2D\",\n sampler2DArrayShadow: \"texture2DArray\",\n samplerCube: \"textureCube\",\n samplerCubeArray: \"textureCubeArray\",\n sampler3D: \"texture3D\",\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nWebGPUShaderProcessor._GpuTextureViewDimensionByWebGPUTextureType = {\n textureCube: \"cube\" /* WebGPUConstants.TextureViewDimension.Cube */,\n textureCubeArray: \"cube-array\" /* WebGPUConstants.TextureViewDimension.CubeArray */,\n texture2D: \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */,\n texture2DArray: \"2d-array\" /* WebGPUConstants.TextureViewDimension.E2dArray */,\n texture3D: \"3d\" /* WebGPUConstants.TextureViewDimension.E3d */,\n};\n// if the webgl sampler type is not listed in this array, \"sampler\" is taken by default\n// eslint-disable-next-line @typescript-eslint/naming-convention\nWebGPUShaderProcessor._SamplerTypeByWebGLSamplerType = {\n sampler2DShadow: \"samplerShadow\",\n sampler2DArrayShadow: \"samplerShadow\",\n};\n// eslint-disable-next-line @typescript-eslint/naming-convention\nWebGPUShaderProcessor._IsComparisonSamplerByWebGPUSamplerType = {\n samplerShadow: true,\n samplerArrayShadow: true,\n sampler: false,\n};\n//# sourceMappingURL=webgpuShaderProcessor.js.map","import { UniformBuffer } from \"../../Materials/uniformBuffer\";\nimport { WebGPUShaderProcessor } from \"./webgpuShaderProcessor\";\n/** @internal */\nexport class WebGPUPipelineContext {\n get isAsync() {\n return false;\n }\n get isReady() {\n if (this.stages) {\n return true;\n }\n return false;\n }\n constructor(shaderProcessingContext, engine) {\n // The field is indexed by textureState. See @WebGPUMaterialContext.textureState for more information.\n this.bindGroupLayouts = {};\n this._name = \"unnamed\";\n this.shaderProcessingContext = shaderProcessingContext;\n this._leftOverUniformsByName = {};\n this.engine = engine;\n this.vertexBufferKindToType = {};\n }\n _handlesSpectorRebuildCallback() {\n // Nothing to do yet for spector.\n }\n _fillEffectInformation(effect, uniformBuffersNames, uniformsNames, uniforms, samplerList, samplers, attributesNames, attributes) {\n const engine = this.engine;\n if (engine._doNotHandleContextLost) {\n effect._fragmentSourceCode = \"\";\n effect._vertexSourceCode = \"\";\n }\n const foundSamplers = this.shaderProcessingContext.availableTextures;\n let index;\n for (index = 0; index < samplerList.length; index++) {\n const name = samplerList[index];\n const sampler = foundSamplers[samplerList[index]];\n if (sampler == null || sampler == undefined) {\n samplerList.splice(index, 1);\n index--;\n }\n else {\n samplers[name] = index;\n }\n }\n for (const attr of engine.getAttributes(this, attributesNames)) {\n attributes.push(attr);\n }\n // Build the uniform layout for the left over uniforms.\n this.buildUniformLayout();\n const attributeNamesFromEffect = [];\n const attributeLocationsFromEffect = [];\n for (index = 0; index < attributesNames.length; index++) {\n const location = attributes[index];\n if (location >= 0) {\n attributeNamesFromEffect.push(attributesNames[index]);\n attributeLocationsFromEffect.push(location);\n }\n }\n this.shaderProcessingContext.attributeNamesFromEffect = attributeNamesFromEffect;\n this.shaderProcessingContext.attributeLocationsFromEffect = attributeLocationsFromEffect;\n }\n /** @internal */\n /**\n * Build the uniform buffer used in the material.\n */\n buildUniformLayout() {\n if (!this.shaderProcessingContext.leftOverUniforms.length) {\n return;\n }\n this.uniformBuffer?.dispose();\n this.uniformBuffer = new UniformBuffer(this.engine, undefined, undefined, \"leftOver-\" + this._name);\n for (const leftOverUniform of this.shaderProcessingContext.leftOverUniforms) {\n const type = leftOverUniform.type.replace(/^(.*?)(<.*>)?$/, \"$1\");\n const size = WebGPUShaderProcessor.UniformSizes[type];\n this.uniformBuffer.addUniform(leftOverUniform.name, size, leftOverUniform.length);\n this._leftOverUniformsByName[leftOverUniform.name] = leftOverUniform.type;\n }\n this.uniformBuffer.create();\n }\n setEngine(engine) {\n this.engine = engine;\n }\n /**\n * Release all associated resources.\n **/\n dispose() {\n if (this.uniformBuffer) {\n this.uniformBuffer.dispose();\n }\n }\n /**\n * Sets an integer value on a uniform variable.\n * @param uniformName Name of the variable.\n * @param value Value to be set.\n */\n setInt(uniformName, value) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateInt(uniformName, value);\n }\n /**\n * Sets an int2 value on a uniform variable.\n * @param uniformName Name of the variable.\n * @param x First int in int2.\n * @param y Second int in int2.\n */\n setInt2(uniformName, x, y) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateInt2(uniformName, x, y);\n }\n /**\n * Sets an int3 value on a uniform variable.\n * @param uniformName Name of the variable.\n * @param x First int in int3.\n * @param y Second int in int3.\n * @param z Third int in int3.\n */\n setInt3(uniformName, x, y, z) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateInt3(uniformName, x, y, z);\n }\n /**\n * Sets an int4 value on a uniform variable.\n * @param uniformName Name of the variable.\n * @param x First int in int4.\n * @param y Second int in int4.\n * @param z Third int in int4.\n * @param w Fourth int in int4.\n */\n setInt4(uniformName, x, y, z, w) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateInt4(uniformName, x, y, z, w);\n }\n /**\n * Sets an int array on a uniform variable.\n * @param uniformName Name of the variable.\n * @param array array to be set.\n */\n setIntArray(uniformName, array) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateIntArray(uniformName, array);\n }\n /**\n * Sets an int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)\n * @param uniformName Name of the variable.\n * @param array array to be set.\n */\n setIntArray2(uniformName, array) {\n this.setIntArray(uniformName, array);\n }\n /**\n * Sets an int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)\n * @param uniformName Name of the variable.\n * @param array array to be set.\n */\n setIntArray3(uniformName, array) {\n this.setIntArray(uniformName, array);\n }\n /**\n * Sets an int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)\n * @param uniformName Name of the variable.\n * @param array array to be set.\n */\n setIntArray4(uniformName, array) {\n this.setIntArray(uniformName, array);\n }\n /**\n * Sets an unsigned integer value on a uniform variable.\n * @param uniformName Name of the variable.\n * @param value Value to be set.\n */\n setUInt(uniformName, value) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateUInt(uniformName, value);\n }\n /**\n * Sets an unsigned int2 value on a uniform variable.\n * @param uniformName Name of the variable.\n * @param x First unsigned int in uint2.\n * @param y Second unsigned int in uint2.\n */\n setUInt2(uniformName, x, y) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateUInt2(uniformName, x, y);\n }\n /**\n * Sets an unsigned int3 value on a uniform variable.\n * @param uniformName Name of the variable.\n * @param x First unsigned int in uint3.\n * @param y Second unsigned int in uint3.\n * @param z Third unsigned int in uint3.\n */\n setUInt3(uniformName, x, y, z) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateUInt3(uniformName, x, y, z);\n }\n /**\n * Sets an unsigned int4 value on a uniform variable.\n * @param uniformName Name of the variable.\n * @param x First unsigned int in uint4.\n * @param y Second unsigned int in uint4.\n * @param z Third unsigned int in uint4.\n * @param w Fourth unsigned int in uint4.\n */\n setUInt4(uniformName, x, y, z, w) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateUInt4(uniformName, x, y, z, w);\n }\n /**\n * Sets an unsigned int array on a uniform variable.\n * @param uniformName Name of the variable.\n * @param array array to be set.\n */\n setUIntArray(uniformName, array) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateUIntArray(uniformName, array);\n }\n /**\n * Sets an unsigned int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)\n * @param uniformName Name of the variable.\n * @param array array to be set.\n */\n setUIntArray2(uniformName, array) {\n this.setUIntArray(uniformName, array);\n }\n /**\n * Sets an unsigned int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)\n * @param uniformName Name of the variable.\n * @param array array to be set.\n */\n setUIntArray3(uniformName, array) {\n this.setUIntArray(uniformName, array);\n }\n /**\n * Sets an unsigned int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)\n * @param uniformName Name of the variable.\n * @param array array to be set.\n */\n setUIntArray4(uniformName, array) {\n this.setUIntArray(uniformName, array);\n }\n /**\n * Sets an array on a uniform variable.\n * @param uniformName Name of the variable.\n * @param array array to be set.\n */\n setArray(uniformName, array) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateArray(uniformName, array);\n }\n /**\n * Sets an array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)\n * @param uniformName Name of the variable.\n * @param array array to be set.\n */\n setArray2(uniformName, array) {\n this.setArray(uniformName, array);\n }\n /**\n * Sets an array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)\n * @param uniformName Name of the variable.\n * @param array array to be set.\n */\n setArray3(uniformName, array) {\n this.setArray(uniformName, array);\n }\n /**\n * Sets an array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)\n * @param uniformName Name of the variable.\n * @param array array to be set.\n */\n setArray4(uniformName, array) {\n this.setArray(uniformName, array);\n }\n /**\n * Sets matrices on a uniform variable.\n * @param uniformName Name of the variable.\n * @param matrices matrices to be set.\n */\n setMatrices(uniformName, matrices) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateMatrices(uniformName, matrices);\n }\n /**\n * Sets matrix on a uniform variable.\n * @param uniformName Name of the variable.\n * @param matrix matrix to be set.\n */\n setMatrix(uniformName, matrix) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateMatrix(uniformName, matrix);\n }\n /**\n * Sets a 3x3 matrix on a uniform variable. (Specified as [1,2,3,4,5,6,7,8,9] will result in [1,2,3][4,5,6][7,8,9] matrix)\n * @param uniformName Name of the variable.\n * @param matrix matrix to be set.\n */\n setMatrix3x3(uniformName, matrix) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateMatrix3x3(uniformName, matrix);\n }\n /**\n * Sets a 2x2 matrix on a uniform variable. (Specified as [1,2,3,4] will result in [1,2][3,4] matrix)\n * @param uniformName Name of the variable.\n * @param matrix matrix to be set.\n */\n setMatrix2x2(uniformName, matrix) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateMatrix2x2(uniformName, matrix);\n }\n /**\n * Sets a float on a uniform variable.\n * @param uniformName Name of the variable.\n * @param value value to be set.\n */\n setFloat(uniformName, value) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateFloat(uniformName, value);\n }\n /**\n * Sets a Vector2 on a uniform variable.\n * @param uniformName Name of the variable.\n * @param vector2 vector2 to be set.\n */\n setVector2(uniformName, vector2) {\n this.setFloat2(uniformName, vector2.x, vector2.y);\n }\n /**\n * Sets a float2 on a uniform variable.\n * @param uniformName Name of the variable.\n * @param x First float in float2.\n * @param y Second float in float2.\n */\n setFloat2(uniformName, x, y) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateFloat2(uniformName, x, y);\n }\n /**\n * Sets a Vector3 on a uniform variable.\n * @param uniformName Name of the variable.\n * @param vector3 Value to be set.\n */\n setVector3(uniformName, vector3) {\n this.setFloat3(uniformName, vector3.x, vector3.y, vector3.z);\n }\n /**\n * Sets a float3 on a uniform variable.\n * @param uniformName Name of the variable.\n * @param x First float in float3.\n * @param y Second float in float3.\n * @param z Third float in float3.\n */\n setFloat3(uniformName, x, y, z) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateFloat3(uniformName, x, y, z);\n }\n /**\n * Sets a Vector4 on a uniform variable.\n * @param uniformName Name of the variable.\n * @param vector4 Value to be set.\n */\n setVector4(uniformName, vector4) {\n this.setFloat4(uniformName, vector4.x, vector4.y, vector4.z, vector4.w);\n }\n /**\n * Sets a Quaternion on a uniform variable.\n * @param uniformName Name of the variable.\n * @param quaternion Value to be set.\n */\n setQuaternion(uniformName, quaternion) {\n this.setFloat4(uniformName, quaternion.x, quaternion.y, quaternion.z, quaternion.w);\n }\n /**\n * Sets a float4 on a uniform variable.\n * @param uniformName Name of the variable.\n * @param x First float in float4.\n * @param y Second float in float4.\n * @param z Third float in float4.\n * @param w Fourth float in float4.\n */\n setFloat4(uniformName, x, y, z, w) {\n if (!this.uniformBuffer || !this._leftOverUniformsByName[uniformName]) {\n return;\n }\n this.uniformBuffer.updateFloat4(uniformName, x, y, z, w);\n }\n /**\n * Sets a Color3 on a uniform variable.\n * @param uniformName Name of the variable.\n * @param color3 Value to be set.\n */\n setColor3(uniformName, color3) {\n this.setFloat3(uniformName, color3.r, color3.g, color3.b);\n }\n /**\n * Sets a Color4 on a uniform variable.\n * @param uniformName Name of the variable.\n * @param color3 Value to be set.\n * @param alpha Alpha value to be set.\n */\n setColor4(uniformName, color3, alpha) {\n this.setFloat4(uniformName, color3.r, color3.g, color3.b, alpha);\n }\n /**\n * Sets a Color4 on a uniform variable\n * @param uniformName defines the name of the variable\n * @param color4 defines the value to be set\n */\n setDirectColor4(uniformName, color4) {\n this.setFloat4(uniformName, color4.r, color4.g, color4.b, color4.a);\n }\n _getVertexShaderCode() {\n return this.sources?.vertex;\n }\n _getFragmentShaderCode() {\n return this.sources?.fragment;\n }\n}\n//# sourceMappingURL=webgpuPipelineContext.js.map","const _maxGroups = 4;\nconst _maxBindingsPerGroup = 1 << 16;\n// all types not listed are assumed to consume 1 location\nconst _typeToLocationSize = {\n // GLSL types\n mat2: 2,\n mat3: 3,\n mat4: 4,\n // WGSL types\n mat2x2: 2,\n mat3x3: 3,\n mat4x4: 4,\n};\n/**\n * @internal\n */\nexport class WebGPUShaderProcessingContext {\n static get KnownUBOs() {\n return WebGPUShaderProcessingContext._SimplifiedKnownBindings ? WebGPUShaderProcessingContext._SimplifiedKnownUBOs : WebGPUShaderProcessingContext._KnownUBOs;\n }\n constructor(shaderLanguage, pureMode = false) {\n this.vertexBufferKindToNumberOfComponents = {};\n this.shaderLanguage = shaderLanguage;\n this._attributeNextLocation = 0;\n this._varyingNextLocation = 0;\n this.freeGroupIndex = 0;\n this.freeBindingIndex = 0;\n this.availableVaryings = {};\n this.availableAttributes = {};\n this.availableBuffers = {};\n this.availableTextures = {};\n this.availableSamplers = {};\n this.orderedAttributes = [];\n this.bindGroupLayoutEntries = [];\n this.bindGroupLayoutEntryInfo = [];\n this.bindGroupEntries = [];\n this.bufferNames = [];\n this.textureNames = [];\n this.samplerNames = [];\n this.leftOverUniforms = [];\n if (!pureMode) {\n this._findStartingGroupBinding();\n }\n }\n _findStartingGroupBinding() {\n const knownUBOs = WebGPUShaderProcessingContext.KnownUBOs;\n const groups = [];\n for (const name in knownUBOs) {\n const binding = knownUBOs[name].binding;\n if (binding.groupIndex === -1) {\n continue;\n }\n if (groups[binding.groupIndex] === undefined) {\n groups[binding.groupIndex] = binding.bindingIndex;\n }\n else {\n groups[binding.groupIndex] = Math.max(groups[binding.groupIndex], binding.bindingIndex);\n }\n }\n this.freeGroupIndex = groups.length - 1;\n if (this.freeGroupIndex === 0) {\n this.freeGroupIndex++;\n this.freeBindingIndex = 0;\n }\n else {\n this.freeBindingIndex = groups[groups.length - 1] + 1;\n }\n }\n getAttributeNextLocation(dataType, arrayLength = 0) {\n const index = this._attributeNextLocation;\n this._attributeNextLocation += (_typeToLocationSize[dataType] ?? 1) * (arrayLength || 1);\n return index;\n }\n getVaryingNextLocation(dataType, arrayLength = 0) {\n const index = this._varyingNextLocation;\n this._varyingNextLocation += (_typeToLocationSize[dataType] ?? 1) * (arrayLength || 1);\n return index;\n }\n getNextFreeUBOBinding() {\n return this._getNextFreeBinding(1);\n }\n _getNextFreeBinding(bindingCount) {\n if (this.freeBindingIndex > _maxBindingsPerGroup - bindingCount) {\n this.freeGroupIndex++;\n this.freeBindingIndex = 0;\n }\n if (this.freeGroupIndex === _maxGroups) {\n // eslint-disable-next-line no-throw-literal\n throw \"Too many textures or UBOs have been declared and it is not supported in WebGPU.\";\n }\n const returnValue = {\n groupIndex: this.freeGroupIndex,\n bindingIndex: this.freeBindingIndex,\n };\n this.freeBindingIndex += bindingCount;\n return returnValue;\n }\n}\n/** @internal */\nWebGPUShaderProcessingContext._SimplifiedKnownBindings = true; // if true, use only group=0,binding=0 as a known group/binding for the Scene ubo and use group=1,binding=X for all other bindings\n// if false, see _KnownUBOs for the known groups/bindings used\nWebGPUShaderProcessingContext._SimplifiedKnownUBOs = {\n Scene: { binding: { groupIndex: 0, bindingIndex: 0 } },\n Light0: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light1: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light2: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light3: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light4: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light5: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light6: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light7: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light8: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light9: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light10: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light11: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light12: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light13: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light14: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light15: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light16: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light17: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light18: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light19: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light20: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light21: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light22: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light23: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light24: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light25: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light26: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light27: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light28: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light29: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light30: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Light31: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Material: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Mesh: { binding: { groupIndex: -1, bindingIndex: -1 } },\n Internals: { binding: { groupIndex: -1, bindingIndex: -1 } },\n};\nWebGPUShaderProcessingContext._KnownUBOs = {\n Scene: { binding: { groupIndex: 0, bindingIndex: 0 } },\n Light0: { binding: { groupIndex: 1, bindingIndex: 0 } },\n Light1: { binding: { groupIndex: 1, bindingIndex: 1 } },\n Light2: { binding: { groupIndex: 1, bindingIndex: 2 } },\n Light3: { binding: { groupIndex: 1, bindingIndex: 3 } },\n Light4: { binding: { groupIndex: 1, bindingIndex: 4 } },\n Light5: { binding: { groupIndex: 1, bindingIndex: 5 } },\n Light6: { binding: { groupIndex: 1, bindingIndex: 6 } },\n Light7: { binding: { groupIndex: 1, bindingIndex: 7 } },\n Light8: { binding: { groupIndex: 1, bindingIndex: 8 } },\n Light9: { binding: { groupIndex: 1, bindingIndex: 9 } },\n Light10: { binding: { groupIndex: 1, bindingIndex: 10 } },\n Light11: { binding: { groupIndex: 1, bindingIndex: 11 } },\n Light12: { binding: { groupIndex: 1, bindingIndex: 12 } },\n Light13: { binding: { groupIndex: 1, bindingIndex: 13 } },\n Light14: { binding: { groupIndex: 1, bindingIndex: 14 } },\n Light15: { binding: { groupIndex: 1, bindingIndex: 15 } },\n Light16: { binding: { groupIndex: 1, bindingIndex: 16 } },\n Light17: { binding: { groupIndex: 1, bindingIndex: 17 } },\n Light18: { binding: { groupIndex: 1, bindingIndex: 18 } },\n Light19: { binding: { groupIndex: 1, bindingIndex: 19 } },\n Light20: { binding: { groupIndex: 1, bindingIndex: 20 } },\n Light21: { binding: { groupIndex: 1, bindingIndex: 21 } },\n Light22: { binding: { groupIndex: 1, bindingIndex: 22 } },\n Light23: { binding: { groupIndex: 1, bindingIndex: 23 } },\n Light24: { binding: { groupIndex: 1, bindingIndex: 24 } },\n Light25: { binding: { groupIndex: 1, bindingIndex: 25 } },\n Light26: { binding: { groupIndex: 1, bindingIndex: 26 } },\n Light27: { binding: { groupIndex: 1, bindingIndex: 27 } },\n Light28: { binding: { groupIndex: 1, bindingIndex: 28 } },\n Light29: { binding: { groupIndex: 1, bindingIndex: 29 } },\n Light30: { binding: { groupIndex: 1, bindingIndex: 30 } },\n Light31: { binding: { groupIndex: 1, bindingIndex: 31 } },\n Material: { binding: { groupIndex: 2, bindingIndex: 0 } },\n Mesh: { binding: { groupIndex: 2, bindingIndex: 1 } },\n Internals: { binding: { groupIndex: 2, bindingIndex: 2 } },\n};\n//# sourceMappingURL=webgpuShaderProcessingContext.js.map","/**\n * Extracts the characters between two markers (for eg, between \"(\" and \")\"). The function handles nested markers as well as markers inside strings (delimited by \", ' or `) and comments\n * @param markerOpen opening marker\n * @param markerClose closing marker\n * @param block code block to parse\n * @param startIndex starting index in block where the extraction must start. The character at block[startIndex] should be the markerOpen character!\n * @returns index of the last character for the extraction (or -1 if the string is invalid - no matching closing marker found). The string to extract (without the markers) is the string between startIndex + 1 and the returned value (exclusive)\n */\nexport function ExtractBetweenMarkers(markerOpen, markerClose, block, startIndex) {\n let currPos = startIndex, openMarkers = 0, waitForChar = \"\";\n while (currPos < block.length) {\n const currChar = block.charAt(currPos);\n if (!waitForChar) {\n switch (currChar) {\n case markerOpen:\n openMarkers++;\n break;\n case markerClose:\n openMarkers--;\n break;\n case '\"':\n case \"'\":\n case \"`\":\n waitForChar = currChar;\n break;\n case \"/\":\n if (currPos + 1 < block.length) {\n const nextChar = block.charAt(currPos + 1);\n if (nextChar === \"/\") {\n waitForChar = \"\\n\";\n }\n else if (nextChar === \"*\") {\n waitForChar = \"*/\";\n }\n }\n break;\n }\n }\n else {\n if (currChar === waitForChar) {\n if (waitForChar === '\"' || waitForChar === \"'\") {\n block.charAt(currPos - 1) !== \"\\\\\" && (waitForChar = \"\");\n }\n else {\n waitForChar = \"\";\n }\n }\n else if (waitForChar === \"*/\" && currChar === \"*\" && currPos + 1 < block.length) {\n block.charAt(currPos + 1) === \"/\" && (waitForChar = \"\");\n if (waitForChar === \"\") {\n currPos++;\n }\n }\n }\n currPos++;\n if (openMarkers === 0) {\n break;\n }\n }\n return openMarkers === 0 ? currPos - 1 : -1;\n}\n/**\n * Parses a string and skip whitespaces\n * @param s string to parse\n * @param index index where to start parsing\n * @returns the index after all whitespaces have been skipped\n */\nexport function SkipWhitespaces(s, index) {\n while (index < s.length) {\n const c = s[index];\n if (c !== \" \" && c !== \"\\n\" && c !== \"\\r\" && c !== \"\\t\" && c !== \"\\u000a\" && c !== \"\\u00a0\") {\n break;\n }\n index++;\n }\n return index;\n}\n/**\n * Checks if a character is an identifier character (meaning, if it is 0-9, A-Z, a-z or _)\n * @param c character to check\n * @returns true if the character is an identifier character\n */\nexport function IsIdentifierChar(c) {\n const v = c.charCodeAt(0);\n return ((v >= 48 && v <= 57) || // 0-9\n (v >= 65 && v <= 90) || // A-Z\n (v >= 97 && v <= 122) || // a-z\n v == 95); // _\n}\n/**\n * Removes the comments of a code block\n * @param block code block to parse\n * @returns block with the comments removed\n */\nexport function RemoveComments(block) {\n let currPos = 0, waitForChar = \"\", inComments = false;\n const s = [];\n while (currPos < block.length) {\n const currChar = block.charAt(currPos);\n if (!waitForChar) {\n switch (currChar) {\n case '\"':\n case \"'\":\n case \"`\":\n waitForChar = currChar;\n break;\n case \"/\":\n if (currPos + 1 < block.length) {\n const nextChar = block.charAt(currPos + 1);\n if (nextChar === \"/\") {\n waitForChar = \"\\n\";\n inComments = true;\n }\n else if (nextChar === \"*\") {\n waitForChar = \"*/\";\n inComments = true;\n }\n }\n break;\n }\n if (!inComments) {\n s.push(currChar);\n }\n }\n else {\n if (currChar === waitForChar) {\n if (waitForChar === '\"' || waitForChar === \"'\") {\n block.charAt(currPos - 1) !== \"\\\\\" && (waitForChar = \"\");\n s.push(currChar);\n }\n else {\n waitForChar = \"\";\n inComments = false;\n }\n }\n else if (waitForChar === \"*/\" && currChar === \"*\" && currPos + 1 < block.length) {\n block.charAt(currPos + 1) === \"/\" && (waitForChar = \"\");\n if (waitForChar === \"\") {\n inComments = false;\n currPos++;\n }\n }\n else {\n if (!inComments) {\n s.push(currChar);\n }\n }\n }\n currPos++;\n }\n return s.join(\"\");\n}\n/**\n * Finds the first occurrence of a character in a string going backward\n * @param s the string to parse\n * @param index starting index in the string\n * @param c the character to find\n * @param c2 an optional second character to find\n * @returns the index of the character if found, else -1\n */\nexport function FindBackward(s, index, c, c2) {\n while (index >= 0 && s.charAt(index) !== c && (!c2 || s.charAt(index) !== c2)) {\n index--;\n }\n return index;\n}\n/**\n * Escapes a string so that it is usable as a regular expression\n * @param s string to escape\n * @returns escaped string\n */\nexport function EscapeRegExp(s) {\n return s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n/**\n * Injects code at the beginning and/or end of a function.\n * The function is identified by \"mainFuncDecl\". The starting code is injected just after the first \"\\{\" found after the mainFuncDecl.\n * The ending code is injected just before the last \"\\}\" of the whole block of code (so, it is assumed that the function is the last of the block of code).\n * @param code code to inject into\n * @param mainFuncDecl Function declaration to find in the code (for eg: \"void main\")\n * @param startingCode The code to inject at the beginning of the function\n * @param endingCode The code to inject at the end of the function\n * @returns The code with the injected code\n */\nexport function InjectStartingAndEndingCode(code, mainFuncDecl, startingCode, endingCode) {\n let idx = code.indexOf(mainFuncDecl);\n if (idx < 0) {\n return code;\n }\n if (startingCode) {\n // eslint-disable-next-line no-empty\n while (idx++ < code.length && code.charAt(idx) != \"{\") { }\n if (idx < code.length) {\n const part1 = code.substring(0, idx + 1);\n const part2 = code.substring(idx + 1);\n code = part1 + startingCode + part2;\n }\n }\n if (endingCode) {\n const lastClosingCurly = code.lastIndexOf(\"}\");\n code = code.substring(0, lastClosingCurly);\n code += endingCode + \"\\n}\";\n }\n return code;\n}\n//# sourceMappingURL=codeStringParsingTools.js.map","import { WebGPUShaderProcessingContext } from \"./webgpuShaderProcessingContext\";\nimport { Logger } from \"../../Misc/logger\";\nimport { WebGPUShaderProcessor } from \"./webgpuShaderProcessor\";\nimport { InjectStartingAndEndingCode } from \"../../Misc/codeStringParsingTools\";\nimport { Constants } from \"../constants\";\n/** @internal */\nexport class WebGPUShaderProcessorGLSL extends WebGPUShaderProcessor {\n constructor() {\n super(...arguments);\n this._missingVaryings = [];\n this._textureArrayProcessing = [];\n this._vertexIsGLES3 = false;\n this._fragmentIsGLES3 = false;\n this.shaderLanguage = 0 /* ShaderLanguage.GLSL */;\n this.parseGLES3 = true;\n }\n _getArraySize(name, type, preProcessors) {\n let length = 0;\n const startArray = name.indexOf(\"[\");\n const endArray = name.indexOf(\"]\");\n if (startArray > 0 && endArray > 0) {\n const lengthInString = name.substring(startArray + 1, endArray);\n length = +lengthInString;\n if (isNaN(length)) {\n length = +preProcessors[lengthInString.trim()];\n }\n name = name.substring(0, startArray);\n }\n return [name, type, length];\n }\n initializeShaders(processingContext) {\n this._webgpuProcessingContext = processingContext;\n this._missingVaryings.length = 0;\n this._textureArrayProcessing.length = 0;\n this.attributeKeywordName = undefined;\n this.varyingVertexKeywordName = undefined;\n this.varyingFragmentKeywordName = undefined;\n }\n preProcessShaderCode(code, isFragment) {\n const ubDeclaration = `// Internals UBO\\nuniform ${WebGPUShaderProcessor.InternalsUBOName} {\\nfloat yFactor_;\\nfloat textureOutputHeight_;\\n};\\n`;\n const alreadyInjected = code.indexOf(\"// Internals UBO\") !== -1;\n if (isFragment) {\n this._fragmentIsGLES3 = code.indexOf(\"#version 3\") !== -1;\n if (this._fragmentIsGLES3) {\n this.varyingFragmentKeywordName = \"in\";\n }\n return alreadyInjected ? code : ubDeclaration + \"##INJECTCODE##\\n\" + code;\n }\n this._vertexIsGLES3 = code.indexOf(\"#version 3\") !== -1;\n if (this._vertexIsGLES3) {\n this.attributeKeywordName = \"in\";\n this.varyingVertexKeywordName = \"out\";\n }\n return alreadyInjected ? code : ubDeclaration + code;\n }\n varyingCheck(varying, isFragment) {\n const outRegex = /(flat\\s)?\\s*\\bout\\b/;\n const inRegex = /(flat\\s)?\\s*\\bin\\b/;\n const varyingRegex = /(flat\\s)?\\s*\\bvarying\\b/;\n const regex = isFragment && this._fragmentIsGLES3 ? inRegex : !isFragment && this._vertexIsGLES3 ? outRegex : varyingRegex;\n return regex.test(varying);\n }\n varyingProcessor(varying, isFragment, preProcessors) {\n this._preProcessors = preProcessors;\n const outRegex = /\\s*(flat)?\\s*out\\s+(?:(?:highp)?|(?:lowp)?)\\s*(\\S+)\\s+(\\S+)\\s*;/gm;\n const inRegex = /\\s*(flat)?\\s*in\\s+(?:(?:highp)?|(?:lowp)?)\\s*(\\S+)\\s+(\\S+)\\s*;/gm;\n const varyingRegex = /\\s*(flat)?\\s*varying\\s+(?:(?:highp)?|(?:lowp)?)\\s*(\\S+)\\s+(\\S+)\\s*;/gm;\n const regex = isFragment && this._fragmentIsGLES3 ? inRegex : !isFragment && this._vertexIsGLES3 ? outRegex : varyingRegex;\n const match = regex.exec(varying);\n if (match !== null) {\n const interpolationQualifier = match[1] ?? \"\";\n const varyingType = match[2];\n const name = match[3];\n let location;\n if (isFragment) {\n location = this._webgpuProcessingContext.availableVaryings[name];\n this._missingVaryings[location] = \"\";\n if (location === undefined) {\n Logger.Warn(`Invalid fragment shader: The varying named \"${name}\" is not declared in the vertex shader! This declaration will be ignored.`);\n }\n }\n else {\n location = this._webgpuProcessingContext.getVaryingNextLocation(varyingType, this._getArraySize(name, varyingType, preProcessors)[2]);\n this._webgpuProcessingContext.availableVaryings[name] = location;\n this._missingVaryings[location] = `layout(location = ${location}) ${interpolationQualifier} in ${varyingType} ${name};`;\n }\n varying = varying.replace(match[0], location === undefined ? \"\" : `layout(location = ${location}) ${interpolationQualifier} ${isFragment ? \"in\" : \"out\"} ${varyingType} ${name};`);\n }\n return varying;\n }\n attributeProcessor(attribute, preProcessors) {\n this._preProcessors = preProcessors;\n const inRegex = /\\s*in\\s+(\\S+)\\s+(\\S+)\\s*;/gm;\n const attribRegex = /\\s*attribute\\s+(\\S+)\\s+(\\S+)\\s*;/gm;\n const regex = this._vertexIsGLES3 ? inRegex : attribRegex;\n const match = regex.exec(attribute);\n if (match !== null) {\n const attributeType = match[1];\n const name = match[2];\n const location = this._webgpuProcessingContext.getAttributeNextLocation(attributeType, this._getArraySize(name, attributeType, preProcessors)[2]);\n this._webgpuProcessingContext.availableAttributes[name] = location;\n this._webgpuProcessingContext.orderedAttributes[location] = name;\n const numComponents = this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents[name];\n if (numComponents !== undefined) {\n // Special case for an int/ivecX vertex buffer that is used as a float/vecX attribute in the shader.\n const newType = numComponents < 0 ? (numComponents === -1 ? \"int\" : \"ivec\" + -numComponents) : numComponents === 1 ? \"uint\" : \"uvec\" + numComponents;\n const newName = `_int_${name}_`;\n attribute = attribute.replace(match[0], `layout(location = ${location}) in ${newType} ${newName}; ${attributeType} ${name} = ${attributeType}(${newName});`);\n }\n else {\n attribute = attribute.replace(match[0], `layout(location = ${location}) in ${attributeType} ${name};`);\n }\n }\n return attribute;\n }\n uniformProcessor(uniform, isFragment, preProcessors) {\n this._preProcessors = preProcessors;\n const uniformRegex = /\\s*uniform\\s+(?:(?:highp)?|(?:lowp)?)\\s*(\\S+)\\s+(\\S+)\\s*;/gm;\n const match = uniformRegex.exec(uniform);\n if (match !== null) {\n let uniformType = match[1];\n let name = match[2];\n if (uniformType.indexOf(\"sampler\") === 0 || uniformType.indexOf(\"sampler\") === 1) {\n let arraySize = 0; // 0 means the texture is not declared as an array\n [name, uniformType, arraySize] = this._getArraySize(name, uniformType, preProcessors);\n let textureInfo = this._webgpuProcessingContext.availableTextures[name];\n if (!textureInfo) {\n textureInfo = {\n autoBindSampler: true,\n isTextureArray: arraySize > 0,\n isStorageTexture: false,\n textures: [],\n sampleType: \"float\" /* WebGPUConstants.TextureSampleType.Float */,\n };\n for (let i = 0; i < (arraySize || 1); ++i) {\n textureInfo.textures.push(this._webgpuProcessingContext.getNextFreeUBOBinding());\n }\n }\n const samplerType = WebGPUShaderProcessor._SamplerTypeByWebGLSamplerType[uniformType] ?? \"sampler\";\n const isComparisonSampler = !!WebGPUShaderProcessor._IsComparisonSamplerByWebGPUSamplerType[samplerType];\n const samplerBindingType = isComparisonSampler ? \"comparison\" /* WebGPUConstants.SamplerBindingType.Comparison */ : \"filtering\" /* WebGPUConstants.SamplerBindingType.Filtering */;\n const samplerName = name + Constants.AUTOSAMPLERSUFFIX;\n let samplerInfo = this._webgpuProcessingContext.availableSamplers[samplerName];\n if (!samplerInfo) {\n samplerInfo = {\n binding: this._webgpuProcessingContext.getNextFreeUBOBinding(),\n type: samplerBindingType,\n };\n }\n const componentType = uniformType.charAt(0) === \"u\" ? \"u\" : uniformType.charAt(0) === \"i\" ? \"i\" : \"\";\n if (componentType) {\n uniformType = uniformType.substring(1);\n }\n const sampleType = isComparisonSampler\n ? \"depth\" /* WebGPUConstants.TextureSampleType.Depth */\n : componentType === \"u\"\n ? \"uint\" /* WebGPUConstants.TextureSampleType.Uint */\n : componentType === \"i\"\n ? \"sint\" /* WebGPUConstants.TextureSampleType.Sint */\n : \"float\" /* WebGPUConstants.TextureSampleType.Float */;\n textureInfo.sampleType = sampleType;\n const isTextureArray = arraySize > 0;\n const samplerGroupIndex = samplerInfo.binding.groupIndex;\n const samplerBindingIndex = samplerInfo.binding.bindingIndex;\n const samplerFunction = WebGPUShaderProcessor._SamplerFunctionByWebGLSamplerType[uniformType];\n const textureType = WebGPUShaderProcessor._TextureTypeByWebGLSamplerType[uniformType];\n const textureDimension = WebGPUShaderProcessor._GpuTextureViewDimensionByWebGPUTextureType[textureType];\n // Manage textures and samplers.\n if (!isTextureArray) {\n arraySize = 1;\n uniform = `layout(set = ${samplerGroupIndex}, binding = ${samplerBindingIndex}) uniform ${samplerType} ${samplerName};\r\n layout(set = ${textureInfo.textures[0].groupIndex}, binding = ${textureInfo.textures[0].bindingIndex}) uniform ${componentType}${textureType} ${name}Texture;\r\n #define ${name} ${componentType}${samplerFunction}(${name}Texture, ${samplerName})`;\n }\n else {\n const layouts = [];\n layouts.push(`layout(set = ${samplerGroupIndex}, binding = ${samplerBindingIndex}) uniform ${componentType}${samplerType} ${samplerName};`);\n uniform = `\\n`;\n for (let i = 0; i < arraySize; ++i) {\n const textureSetIndex = textureInfo.textures[i].groupIndex;\n const textureBindingIndex = textureInfo.textures[i].bindingIndex;\n layouts.push(`layout(set = ${textureSetIndex}, binding = ${textureBindingIndex}) uniform ${textureType} ${name}Texture${i};`);\n uniform += `${i > 0 ? \"\\n\" : \"\"}#define ${name}${i} ${componentType}${samplerFunction}(${name}Texture${i}, ${samplerName})`;\n }\n uniform = layouts.join(\"\\n\") + uniform;\n this._textureArrayProcessing.push(name);\n }\n this._webgpuProcessingContext.availableTextures[name] = textureInfo;\n this._webgpuProcessingContext.availableSamplers[samplerName] = samplerInfo;\n this._addSamplerBindingDescription(samplerName, samplerInfo, !isFragment);\n for (let i = 0; i < arraySize; ++i) {\n this._addTextureBindingDescription(name, textureInfo, i, textureDimension, null, !isFragment);\n }\n }\n else {\n this._addUniformToLeftOverUBO(name, uniformType, preProcessors);\n uniform = \"\";\n }\n }\n return uniform;\n }\n uniformBufferProcessor(uniformBuffer, isFragment) {\n const uboRegex = /uniform\\s+(\\w+)/gm;\n const match = uboRegex.exec(uniformBuffer);\n if (match !== null) {\n const name = match[1];\n let uniformBufferInfo = this._webgpuProcessingContext.availableBuffers[name];\n if (!uniformBufferInfo) {\n const knownUBO = WebGPUShaderProcessingContext.KnownUBOs[name];\n let binding;\n if (knownUBO && knownUBO.binding.groupIndex !== -1) {\n binding = knownUBO.binding;\n }\n else {\n binding = this._webgpuProcessingContext.getNextFreeUBOBinding();\n }\n uniformBufferInfo = { binding };\n this._webgpuProcessingContext.availableBuffers[name] = uniformBufferInfo;\n }\n this._addBufferBindingDescription(name, uniformBufferInfo, \"uniform\" /* WebGPUConstants.BufferBindingType.Uniform */, !isFragment);\n uniformBuffer = uniformBuffer.replace(\"uniform\", `layout(set = ${uniformBufferInfo.binding.groupIndex}, binding = ${uniformBufferInfo.binding.bindingIndex}) uniform`);\n }\n return uniformBuffer;\n }\n postProcessor(code, defines, isFragment, _processingContext, _parameters) {\n const hasDrawBuffersExtension = code.search(/#extension.+GL_EXT_draw_buffers.+require/) !== -1;\n // Remove extensions\n const regex = /#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g;\n code = code.replace(regex, \"\");\n // Replace instructions\n code = code.replace(/texture2D\\s*\\(/g, \"texture(\");\n if (isFragment) {\n const hasFragCoord = code.indexOf(\"gl_FragCoord\") >= 0;\n const fragCoordCode = `\r\n glFragCoord_ = gl_FragCoord;\r\n if (yFactor_ == 1.) {\r\n glFragCoord_.y = textureOutputHeight_ - glFragCoord_.y;\r\n }\r\n `;\n const injectCode = hasFragCoord ? \"vec4 glFragCoord_;\\n\" : \"\";\n const hasOutput = code.search(/layout *\\(location *= *0\\) *out/g) !== -1;\n code = code.replace(/texture2DLodEXT\\s*\\(/g, \"textureLod(\");\n code = code.replace(/textureCubeLodEXT\\s*\\(/g, \"textureLod(\");\n code = code.replace(/textureCube\\s*\\(/g, \"texture(\");\n code = code.replace(/gl_FragDepthEXT/g, \"gl_FragDepth\");\n code = code.replace(/gl_FragColor/g, \"glFragColor\");\n code = code.replace(/gl_FragData/g, \"glFragData\");\n code = code.replace(/gl_FragCoord/g, \"glFragCoord_\");\n if (!this._fragmentIsGLES3) {\n code = code.replace(/void\\s+?main\\s*\\(/g, (hasDrawBuffersExtension || hasOutput ? \"\" : \"layout(location = 0) out vec4 glFragColor;\\n\") + \"void main(\");\n }\n else {\n const match = /^\\s*out\\s+\\S+\\s+\\S+\\s*;/gm.exec(code);\n if (match !== null) {\n code = code.substring(0, match.index) + \"layout(location = 0) \" + code.substring(match.index);\n }\n }\n code = code.replace(/dFdy/g, \"(-yFactor_)*dFdy\"); // will also handle dFdyCoarse and dFdyFine\n code = code.replace(\"##INJECTCODE##\", injectCode);\n if (hasFragCoord) {\n code = InjectStartingAndEndingCode(code, \"void main\", fragCoordCode);\n }\n }\n else {\n code = code.replace(/gl_InstanceID/g, \"gl_InstanceIndex\");\n code = code.replace(/gl_VertexID/g, \"gl_VertexIndex\");\n const hasMultiviewExtension = defines.indexOf(\"#define MULTIVIEW\") !== -1;\n if (hasMultiviewExtension) {\n return \"#extension GL_OVR_multiview2 : require\\nlayout (num_views = 2) in;\\n\" + code;\n }\n }\n // Flip Y + convert z range from [-1,1] to [0,1]\n if (!isFragment) {\n const lastClosingCurly = code.lastIndexOf(\"}\");\n code = code.substring(0, lastClosingCurly);\n code += \"gl_Position.y *= yFactor_;\\n\";\n // isNDCHalfZRange is always true in WebGPU\n code += \"}\";\n }\n return code;\n }\n _applyTextureArrayProcessing(code, name) {\n // Replaces the occurrences of name[XX] by nameXX\n const regex = new RegExp(name + \"\\\\s*\\\\[(.+)?\\\\]\", \"gm\");\n let match = regex.exec(code);\n while (match !== null) {\n const index = match[1];\n let iindex = +index;\n if (this._preProcessors && isNaN(iindex)) {\n iindex = +this._preProcessors[index.trim()];\n }\n code = code.replace(match[0], name + iindex);\n match = regex.exec(code);\n }\n return code;\n }\n _generateLeftOverUBOCode(name, uniformBufferDescription) {\n let ubo = `layout(set = ${uniformBufferDescription.binding.groupIndex}, binding = ${uniformBufferDescription.binding.bindingIndex}) uniform ${name} {\\n `;\n for (const leftOverUniform of this._webgpuProcessingContext.leftOverUniforms) {\n if (leftOverUniform.length > 0) {\n ubo += ` ${leftOverUniform.type} ${leftOverUniform.name}[${leftOverUniform.length}];\\n`;\n }\n else {\n ubo += ` ${leftOverUniform.type} ${leftOverUniform.name};\\n`;\n }\n }\n ubo += \"};\\n\\n\";\n return ubo;\n }\n finalizeShaders(vertexCode, fragmentCode) {\n // make replacements for texture names in the texture array case\n for (let i = 0; i < this._textureArrayProcessing.length; ++i) {\n const name = this._textureArrayProcessing[i];\n vertexCode = this._applyTextureArrayProcessing(vertexCode, name);\n fragmentCode = this._applyTextureArrayProcessing(fragmentCode, name);\n }\n // inject the missing varying in the fragment shader\n for (let i = 0; i < this._missingVaryings.length; ++i) {\n const decl = this._missingVaryings[i];\n if (decl && decl.length > 0) {\n fragmentCode = decl + \"\\n\" + fragmentCode;\n }\n }\n // Builds the leftover UBOs.\n const leftOverUBO = this._buildLeftOverUBO();\n vertexCode = leftOverUBO + vertexCode;\n fragmentCode = leftOverUBO + fragmentCode;\n this._collectBindingNames();\n this._preCreateBindGroupEntries();\n this._preProcessors = null;\n this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents = {};\n return { vertexCode, fragmentCode };\n }\n}\n//# sourceMappingURL=webgpuShaderProcessorsGLSL.js.map","import { WebGPUShaderProcessingContext } from \"./webgpuShaderProcessingContext\";\nimport { Logger } from \"../../Misc/logger\";\nimport { WebGPUShaderProcessor } from \"./webgpuShaderProcessor\";\nimport { RemoveComments, InjectStartingAndEndingCode } from \"../../Misc/codeStringParsingTools\";\nimport { Constants } from \"../constants\";\nimport \"../../ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration\";\nimport \"../../ShadersWGSL/ShadersInclude/bakedVertexAnimation\";\nimport \"../../ShadersWGSL/ShadersInclude/instancesDeclaration\";\nimport \"../../ShadersWGSL/ShadersInclude/instancesVertex\";\nimport \"../../ShadersWGSL/ShadersInclude/helperFunctions\";\nimport \"../../ShadersWGSL/ShadersInclude/fresnelFunction\";\nimport \"../../ShadersWGSL/ShadersInclude/meshUboDeclaration\";\nimport \"../../ShadersWGSL/ShadersInclude/sceneUboDeclaration\";\nimport \"../../ShadersWGSL/ShadersInclude/decalFragment\";\nconst builtInName_frag_depth = \"fragmentOutputs.fragDepth\";\nconst leftOverVarName = \"uniforms\";\nconst internalsVarName = \"internals\";\nconst gpuTextureViewDimensionByWebGPUTextureFunction = {\n texture_1d: \"1d\" /* WebGPUConstants.TextureViewDimension.E1d */,\n texture_2d: \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */,\n texture_2d_array: \"2d-array\" /* WebGPUConstants.TextureViewDimension.E2dArray */,\n texture_3d: \"3d\" /* WebGPUConstants.TextureViewDimension.E3d */,\n texture_cube: \"cube\" /* WebGPUConstants.TextureViewDimension.Cube */,\n texture_cube_array: \"cube-array\" /* WebGPUConstants.TextureViewDimension.CubeArray */,\n texture_multisampled_2d: \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */,\n texture_depth_2d: \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */,\n texture_depth_2d_array: \"2d-array\" /* WebGPUConstants.TextureViewDimension.E2dArray */,\n texture_depth_cube: \"cube\" /* WebGPUConstants.TextureViewDimension.Cube */,\n texture_depth_cube_array: \"cube-array\" /* WebGPUConstants.TextureViewDimension.CubeArray */,\n texture_depth_multisampled_2d: \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */,\n texture_storage_1d: \"1d\" /* WebGPUConstants.TextureViewDimension.E1d */,\n texture_storage_2d: \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */,\n texture_storage_2d_array: \"2d-array\" /* WebGPUConstants.TextureViewDimension.E2dArray */,\n texture_storage_3d: \"3d\" /* WebGPUConstants.TextureViewDimension.E3d */,\n texture_external: null,\n};\n/** @internal */\nexport class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor {\n constructor() {\n super(...arguments);\n this.shaderLanguage = 1 /* ShaderLanguage.WGSL */;\n this.uniformRegexp = /uniform\\s+(\\w+)\\s*:\\s*(.+)\\s*;/;\n this.textureRegexp = /var\\s+(\\w+)\\s*:\\s*((array<\\s*)?(texture_\\w+)\\s*(<\\s*(.+)\\s*>)?\\s*(,\\s*\\w+\\s*>\\s*)?);/;\n this.noPrecision = true;\n this.pureMode = false;\n }\n preProcessor(code, defines, preProcessors, isFragment, processingContext) {\n // Convert defines into const\n for (const key in preProcessors) {\n if (key === \"__VERSION__\") {\n continue;\n }\n const value = preProcessors[key];\n if (!isNaN(parseInt(value)) || !isNaN(parseFloat(value))) {\n code = `const ${key} = ${value};\\n` + code;\n }\n }\n return code;\n }\n _getArraySize(name, uniformType, preProcessors) {\n let length = 0;\n const endArray = uniformType.lastIndexOf(\">\");\n if (uniformType.indexOf(\"array\") >= 0 && endArray > 0) {\n let startArray = endArray;\n while (startArray > 0 && uniformType.charAt(startArray) !== \" \" && uniformType.charAt(startArray) !== \",\") {\n startArray--;\n }\n const lengthInString = uniformType.substring(startArray + 1, endArray);\n length = +lengthInString;\n if (isNaN(length)) {\n length = +preProcessors[lengthInString.trim()];\n }\n while (startArray > 0 && (uniformType.charAt(startArray) === \" \" || uniformType.charAt(startArray) === \",\")) {\n startArray--;\n }\n uniformType = uniformType.substring(uniformType.indexOf(\"<\") + 1, startArray + 1);\n }\n return [name, uniformType, length];\n }\n initializeShaders(processingContext) {\n this._webgpuProcessingContext = processingContext;\n this._attributesInputWGSL = [];\n this._attributesWGSL = [];\n this._attributesConversionCodeWGSL = [];\n this._hasNonFloatAttribute = false;\n this._varyingsWGSL = [];\n this._varyingNamesWGSL = [];\n this._stridedUniformArrays = [];\n }\n preProcessShaderCode(code) {\n // Same check as in webgpuShaderProcessorsGLSL to avoid same ubDelcaration to be injected twice.\n const ubDeclaration = this.pureMode\n ? \"\"\n : `struct ${WebGPUShaderProcessor.InternalsUBOName} {\\n yFactor_: f32,\\n textureOutputHeight_: f32,\\n};\\nvar<uniform> ${internalsVarName} : ${WebGPUShaderProcessor.InternalsUBOName};\\n`;\n const alreadyInjected = code.indexOf(ubDeclaration) !== -1;\n return alreadyInjected ? code : ubDeclaration + RemoveComments(code);\n }\n varyingCheck(varying) {\n const regex = /(flat|linear|perspective)?\\s*(center|centroid|sample)?\\s*\\bvarying\\b/;\n return regex.test(varying);\n }\n varyingProcessor(varying, isFragment, preProcessors) {\n const varyingRegex = /\\s*(flat|linear|perspective)?\\s*(center|centroid|sample)?\\s*varying\\s+(?:(?:highp)?|(?:lowp)?)\\s*(\\S+)\\s*:\\s*(.+)\\s*;/gm;\n const match = varyingRegex.exec(varying);\n if (match !== null) {\n const interpolationType = match[1] ?? \"perspective\";\n const interpolationSampling = match[2] ?? \"center\";\n const varyingType = match[4];\n const name = match[3];\n const interpolation = interpolationType === \"flat\" ? `@interpolate(${interpolationType})` : `@interpolate(${interpolationType}, ${interpolationSampling})`;\n let location;\n if (isFragment) {\n location = this._webgpuProcessingContext.availableVaryings[name];\n if (location === undefined) {\n Logger.Warn(`Invalid fragment shader: The varying named \"${name}\" is not declared in the vertex shader! This declaration will be ignored.`);\n }\n }\n else {\n location = this._webgpuProcessingContext.getVaryingNextLocation(varyingType, this._getArraySize(name, varyingType, preProcessors)[2]);\n this._webgpuProcessingContext.availableVaryings[name] = location;\n this._varyingsWGSL.push(` @location(${location}) ${interpolation} ${name} : ${varyingType},`);\n this._varyingNamesWGSL.push(name);\n }\n varying = \"\";\n }\n return varying;\n }\n attributeProcessor(attribute, preProcessors) {\n const attribRegex = /\\s*attribute\\s+(\\S+)\\s*:\\s*(.+)\\s*;/gm;\n const match = attribRegex.exec(attribute);\n if (match !== null) {\n const attributeType = match[2];\n const name = match[1];\n const location = this._webgpuProcessingContext.getAttributeNextLocation(attributeType, this._getArraySize(name, attributeType, preProcessors)[2]);\n this._webgpuProcessingContext.availableAttributes[name] = location;\n this._webgpuProcessingContext.orderedAttributes[location] = name;\n const numComponents = this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents[name];\n if (numComponents !== undefined) {\n // Special case for an int/ivecX vertex buffer that is used as a float/vecX attribute in the shader.\n const newType = numComponents < 0 ? (numComponents === -1 ? \"i32\" : \"vec\" + -numComponents + \"<i32>\") : numComponents === 1 ? \"u32\" : \"vec\" + numComponents + \"<u32>\";\n const newName = `_int_${name}_`;\n this._attributesInputWGSL.push(`@location(${location}) ${newName} : ${newType},`);\n this._attributesWGSL.push(`${name} : ${attributeType},`);\n this._attributesConversionCodeWGSL.push(`vertexInputs.${name} = ${attributeType}(vertexInputs_.${newName});`);\n this._hasNonFloatAttribute = true;\n }\n else {\n this._attributesInputWGSL.push(`@location(${location}) ${name} : ${attributeType},`);\n this._attributesWGSL.push(`${name} : ${attributeType},`);\n this._attributesConversionCodeWGSL.push(`vertexInputs.${name} = vertexInputs_.${name};`);\n }\n attribute = \"\";\n }\n return attribute;\n }\n uniformProcessor(uniform, isFragment, preProcessors) {\n const match = this.uniformRegexp.exec(uniform);\n if (match !== null) {\n const uniformType = match[2];\n const name = match[1];\n this._addUniformToLeftOverUBO(name, uniformType, preProcessors);\n uniform = \"\";\n }\n return uniform;\n }\n textureProcessor(texture, isFragment, preProcessors) {\n const match = this.textureRegexp.exec(texture);\n if (match !== null) {\n const name = match[1]; // name of the variable\n const type = match[2]; // texture_2d<f32> or array<texture_2d_array<f32>, 5> for eg\n const isArrayOfTexture = !!match[3];\n const textureFunc = match[4]; // texture_2d, texture_depth_2d, etc\n const isStorageTexture = textureFunc.indexOf(\"storage\") > 0;\n const componentType = match[6]; // f32 or i32 or u32 or undefined\n const storageTextureFormat = isStorageTexture ? componentType.substring(0, componentType.indexOf(\",\")).trim() : null;\n let arraySize = isArrayOfTexture ? this._getArraySize(name, type, preProcessors)[2] : 0;\n let textureInfo = this._webgpuProcessingContext.availableTextures[name];\n if (!textureInfo) {\n textureInfo = {\n isTextureArray: arraySize > 0,\n isStorageTexture,\n textures: [],\n sampleType: \"float\" /* WebGPUConstants.TextureSampleType.Float */,\n };\n arraySize = arraySize || 1;\n for (let i = 0; i < arraySize; ++i) {\n textureInfo.textures.push(this._webgpuProcessingContext.getNextFreeUBOBinding());\n }\n }\n else {\n arraySize = textureInfo.textures.length;\n }\n this._webgpuProcessingContext.availableTextures[name] = textureInfo;\n const isDepthTexture = textureFunc.indexOf(\"depth\") > 0;\n const textureDimension = gpuTextureViewDimensionByWebGPUTextureFunction[textureFunc];\n const sampleType = isDepthTexture\n ? \"depth\" /* WebGPUConstants.TextureSampleType.Depth */\n : componentType === \"u32\"\n ? \"uint\" /* WebGPUConstants.TextureSampleType.Uint */\n : componentType === \"i32\"\n ? \"sint\" /* WebGPUConstants.TextureSampleType.Sint */\n : \"float\" /* WebGPUConstants.TextureSampleType.Float */;\n textureInfo.sampleType = sampleType;\n if (textureDimension === undefined) {\n // eslint-disable-next-line no-throw-literal\n throw `Can't get the texture dimension corresponding to the texture function \"${textureFunc}\"!`;\n }\n for (let i = 0; i < arraySize; ++i) {\n const { groupIndex, bindingIndex } = textureInfo.textures[i];\n if (i === 0) {\n texture = `@group(${groupIndex}) @binding(${bindingIndex}) ${texture}`;\n }\n this._addTextureBindingDescription(name, textureInfo, i, textureDimension, storageTextureFormat, !isFragment);\n }\n }\n return texture;\n }\n // We need to process defines which are directly in the files themselves\n postProcessor(code) {\n const definePattern = /#define (.+?) (.+?)$/gm;\n let match;\n while ((match = definePattern.exec(code)) !== null) {\n code = code.replace(new RegExp(match[1], \"g\"), match[2]);\n }\n return code;\n }\n finalizeShaders(vertexCode, fragmentCode) {\n const fragCoordCode = fragmentCode.indexOf(\"fragmentInputs.position\") >= 0 && !this.pureMode\n ? `\r\n if (internals.yFactor_ == 1.) {\r\n fragmentInputs.position.y = internals.textureOutputHeight_ - fragmentInputs.position.y;\r\n }\r\n `\n : \"\";\n // Add the group/binding info to the sampler declaration (var xxx: sampler|sampler_comparison)\n vertexCode = this._processSamplers(vertexCode, true);\n fragmentCode = this._processSamplers(fragmentCode, false);\n // Add the group/binding info to the uniform/storage buffer declarations (var<uniform> XXX:YYY or var<storage(,read_write|read)> XXX:YYY)\n vertexCode = this._processCustomBuffers(vertexCode, true);\n fragmentCode = this._processCustomBuffers(fragmentCode, false);\n // Builds the leftover UBOs.\n const leftOverUBO = this._buildLeftOverUBO();\n vertexCode = leftOverUBO + vertexCode;\n fragmentCode = leftOverUBO + fragmentCode;\n // Vertex code\n vertexCode = vertexCode.replace(/#define (\\w+)\\s+(\\d+\\.?\\d*)/g, \"const $1 = $2;\");\n vertexCode = vertexCode.replace(/#define /g, \"//#define \");\n vertexCode = this._processStridedUniformArrays(vertexCode);\n let vertexInputs = \"struct VertexInputs {\\n @builtin(vertex_index) vertexIndex : u32,\\n @builtin(instance_index) instanceIndex : u32,\\n\";\n if (this._attributesInputWGSL.length > 0) {\n vertexInputs += this._attributesInputWGSL.join(\"\\n\");\n }\n vertexInputs += \"\\n};\\nvar<private> vertexInputs\" + (this._hasNonFloatAttribute ? \"_\" : \"\") + \" : VertexInputs;\\n\";\n if (this._hasNonFloatAttribute) {\n vertexInputs += \"struct VertexInputs_ {\\n vertexIndex : u32, instanceIndex : u32,\\n\";\n vertexInputs += this._attributesWGSL.join(\"\\n\");\n vertexInputs += \"\\n};\\nvar<private> vertexInputs : VertexInputs_;\\n\";\n }\n let vertexOutputs = \"struct FragmentInputs {\\n @builtin(position) position : vec4<f32>,\\n\";\n if (this._varyingsWGSL.length > 0) {\n vertexOutputs += this._varyingsWGSL.join(\"\\n\");\n }\n vertexOutputs += \"\\n};\\nvar<private> vertexOutputs : FragmentInputs;\\n\";\n vertexCode = vertexInputs + vertexOutputs + vertexCode;\n let vertexMainStartingCode = `\\n vertexInputs${this._hasNonFloatAttribute ? \"_\" : \"\"} = input;\\n`;\n if (this._hasNonFloatAttribute) {\n vertexMainStartingCode += \"vertexInputs.vertexIndex = vertexInputs_.vertexIndex;\\nvertexInputs.instanceIndex = vertexInputs_.instanceIndex;\\n\";\n vertexMainStartingCode += this._attributesConversionCodeWGSL.join(\"\\n\");\n vertexMainStartingCode += \"\\n\";\n }\n const vertexMainEndingCode = this.pureMode\n ? ` return vertexOutputs;`\n : ` vertexOutputs.position.y = vertexOutputs.position.y * internals.yFactor_;\\n return vertexOutputs;`;\n let needDiagnosticOff = vertexCode.indexOf(Constants.DISABLEUA) !== -1;\n vertexCode =\n (needDiagnosticOff ? \"diagnostic(off, derivative_uniformity);\\n\" : \"\") +\n \"diagnostic(off, chromium.unreachable_code);\\n\" +\n InjectStartingAndEndingCode(vertexCode, \"fn main\", vertexMainStartingCode, vertexMainEndingCode);\n // fragment code\n fragmentCode = fragmentCode.replace(/#define (\\w+)\\s+(\\d+\\.?\\d*)/g, \"const $1 = $2;\");\n fragmentCode = fragmentCode.replace(/#define /g, \"//#define \");\n fragmentCode = this._processStridedUniformArrays(fragmentCode);\n if (!this.pureMode) {\n fragmentCode = fragmentCode.replace(/dpdy/g, \"(-internals.yFactor_)*dpdy\"); // will also handle dpdyCoarse and dpdyFine\n }\n let fragmentInputs = \"struct FragmentInputs {\\n @builtin(position) position : vec4<f32>,\\n @builtin(front_facing) frontFacing : bool,\\n\";\n if (this._varyingsWGSL.length > 0) {\n fragmentInputs += this._varyingsWGSL.join(\"\\n\");\n }\n fragmentInputs += \"\\n};\\nvar<private> fragmentInputs : FragmentInputs;\\n\";\n let fragmentOutputs = \"struct FragmentOutputs {\\n\";\n // Adding fragData output locations\n const regexRoot = \"fragmentOutputs\\\\.fragData\";\n let match = fragmentCode.match(new RegExp(regexRoot + \"0\", \"g\"));\n let indexLocation = 0;\n if (match) {\n fragmentOutputs += ` @location(${indexLocation}) fragData0 : vec4<f32>,\\n`;\n indexLocation++;\n for (let index = 1; index < 8; index++) {\n match = fragmentCode.match(new RegExp(regexRoot + index, \"g\"));\n if (match) {\n fragmentOutputs += ` @location(${indexLocation}) fragData${indexLocation} : vec4<f32>,\\n`;\n indexLocation++;\n }\n }\n if (fragmentCode.indexOf(\"MRT_AND_COLOR\") !== -1) {\n fragmentOutputs += ` @location(${indexLocation}) color : vec4<f32>,\\n`;\n indexLocation++;\n }\n }\n // Adding fragData output locations\n const regex = /oitDepthSampler/;\n match = fragmentCode.match(regex);\n if (match) {\n fragmentOutputs += ` @location(${indexLocation++}) depth : vec2<f32>,\\n`;\n fragmentOutputs += ` @location(${indexLocation++}) frontColor : vec4<f32>,\\n`;\n fragmentOutputs += ` @location(${indexLocation++}) backColor : vec4<f32>,\\n`;\n }\n if (indexLocation === 0) {\n fragmentOutputs += \" @location(0) color : vec4<f32>,\\n\";\n indexLocation++;\n }\n // FragDepth\n let hasFragDepth = false;\n let idx = 0;\n while (!hasFragDepth) {\n idx = fragmentCode.indexOf(builtInName_frag_depth, idx);\n if (idx < 0) {\n break;\n }\n const saveIndex = idx;\n hasFragDepth = true;\n while (idx > 1 && fragmentCode.charAt(idx) !== \"\\n\") {\n if (fragmentCode.charAt(idx) === \"/\" && fragmentCode.charAt(idx - 1) === \"/\") {\n hasFragDepth = false;\n break;\n }\n idx--;\n }\n idx = saveIndex + builtInName_frag_depth.length;\n }\n if (hasFragDepth) {\n fragmentOutputs += \" @builtin(frag_depth) fragDepth: f32,\\n\";\n }\n fragmentOutputs += \"};\\nvar<private> fragmentOutputs : FragmentOutputs;\\n\";\n fragmentCode = fragmentInputs + fragmentOutputs + fragmentCode;\n const fragmentStartingCode = \" fragmentInputs = input;\\n \" + fragCoordCode;\n const fragmentEndingCode = \" return fragmentOutputs;\";\n needDiagnosticOff = fragmentCode.indexOf(Constants.DISABLEUA) !== -1;\n fragmentCode =\n (needDiagnosticOff ? \"diagnostic(off, derivative_uniformity);\\n\" : \"\") +\n \"diagnostic(off, chromium.unreachable_code);\\n\" +\n InjectStartingAndEndingCode(fragmentCode, \"fn main\", fragmentStartingCode, fragmentEndingCode);\n this._collectBindingNames();\n this._preCreateBindGroupEntries();\n this._webgpuProcessingContext.vertexBufferKindToNumberOfComponents = {};\n return { vertexCode, fragmentCode };\n }\n _generateLeftOverUBOCode(name, uniformBufferDescription) {\n let stridedArrays = \"\";\n let ubo = `struct ${name} {\\n`;\n for (const leftOverUniform of this._webgpuProcessingContext.leftOverUniforms) {\n const type = leftOverUniform.type.replace(/^(.*?)(<.*>)?$/, \"$1\");\n const size = WebGPUShaderProcessor.UniformSizes[type];\n if (leftOverUniform.length > 0) {\n if (size <= 2) {\n const stridedArrayType = `${name}_${this._stridedUniformArrays.length}_strided_arr`;\n stridedArrays += `struct ${stridedArrayType} {\r\n @size(16)\r\n el: ${type},\r\n }`;\n this._stridedUniformArrays.push(leftOverUniform.name);\n ubo += ` @align(16) ${leftOverUniform.name} : array<${stridedArrayType}, ${leftOverUniform.length}>,\\n`;\n }\n else {\n ubo += ` ${leftOverUniform.name} : array<${leftOverUniform.type}, ${leftOverUniform.length}>,\\n`;\n }\n }\n else {\n ubo += ` ${leftOverUniform.name} : ${leftOverUniform.type},\\n`;\n }\n }\n ubo += \"};\\n\";\n ubo = `${stridedArrays}\\n${ubo}`;\n ubo += `@group(${uniformBufferDescription.binding.groupIndex}) @binding(${uniformBufferDescription.binding.bindingIndex}) var<uniform> ${leftOverVarName} : ${name};\\n`;\n return ubo;\n }\n _processSamplers(code, isVertex) {\n const samplerRegexp = /var\\s+(\\w+Sampler)\\s*:\\s*(sampler|sampler_comparison)\\s*;/gm;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const match = samplerRegexp.exec(code);\n if (match === null) {\n break;\n }\n const name = match[1]; // name of the variable\n const samplerType = match[2]; // sampler or sampler_comparison\n const suffixLessLength = name.length - Constants.AUTOSAMPLERSUFFIX.length;\n const textureName = name.lastIndexOf(Constants.AUTOSAMPLERSUFFIX) === suffixLessLength ? name.substring(0, suffixLessLength) : null;\n const samplerBindingType = samplerType === \"sampler_comparison\" ? \"comparison\" /* WebGPUConstants.SamplerBindingType.Comparison */ : \"filtering\" /* WebGPUConstants.SamplerBindingType.Filtering */;\n if (textureName) {\n const textureInfo = this._webgpuProcessingContext.availableTextures[textureName];\n if (textureInfo) {\n textureInfo.autoBindSampler = true;\n }\n }\n let samplerInfo = this._webgpuProcessingContext.availableSamplers[name];\n if (!samplerInfo) {\n samplerInfo = {\n binding: this._webgpuProcessingContext.getNextFreeUBOBinding(),\n type: samplerBindingType,\n };\n this._webgpuProcessingContext.availableSamplers[name] = samplerInfo;\n }\n this._addSamplerBindingDescription(name, samplerInfo, isVertex);\n const part1 = code.substring(0, match.index);\n const insertPart = `@group(${samplerInfo.binding.groupIndex}) @binding(${samplerInfo.binding.bindingIndex}) `;\n const part2 = code.substring(match.index);\n code = part1 + insertPart + part2;\n samplerRegexp.lastIndex += insertPart.length;\n }\n return code;\n }\n _processCustomBuffers(code, isVertex) {\n const instantiateBufferRegexp = /var<\\s*(uniform|storage)\\s*(,\\s*(read|read_write)\\s*)?>\\s+(\\S+)\\s*:\\s*(\\S+)\\s*;/gm;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const match = instantiateBufferRegexp.exec(code);\n if (match === null) {\n break;\n }\n const type = match[1];\n const decoration = match[3];\n let name = match[4];\n const structName = match[5];\n let bufferInfo = this._webgpuProcessingContext.availableBuffers[name];\n if (!bufferInfo) {\n const knownUBO = type === \"uniform\" ? WebGPUShaderProcessingContext.KnownUBOs[structName] : null;\n let binding;\n if (knownUBO) {\n name = structName;\n binding = knownUBO.binding;\n if (binding.groupIndex === -1) {\n binding = this._webgpuProcessingContext.availableBuffers[name]?.binding;\n if (!binding) {\n binding = this._webgpuProcessingContext.getNextFreeUBOBinding();\n }\n }\n }\n else {\n binding = this._webgpuProcessingContext.getNextFreeUBOBinding();\n }\n bufferInfo = { binding };\n this._webgpuProcessingContext.availableBuffers[name] = bufferInfo;\n }\n this._addBufferBindingDescription(name, this._webgpuProcessingContext.availableBuffers[name], decoration === \"read_write\"\n ? \"storage\" /* WebGPUConstants.BufferBindingType.Storage */\n : type === \"storage\"\n ? \"read-only-storage\" /* WebGPUConstants.BufferBindingType.ReadOnlyStorage */\n : \"uniform\" /* WebGPUConstants.BufferBindingType.Uniform */, isVertex);\n const groupIndex = bufferInfo.binding.groupIndex;\n const bindingIndex = bufferInfo.binding.bindingIndex;\n const part1 = code.substring(0, match.index);\n const insertPart = `@group(${groupIndex}) @binding(${bindingIndex}) `;\n const part2 = code.substring(match.index);\n code = part1 + insertPart + part2;\n instantiateBufferRegexp.lastIndex += insertPart.length;\n }\n return code;\n }\n _processStridedUniformArrays(code) {\n for (const uniformArrayName of this._stridedUniformArrays) {\n code = code.replace(new RegExp(`${uniformArrayName}\\\\s*\\\\[(.*?)\\\\]`, \"g\"), `${uniformArrayName}[$1].el`);\n }\n return code;\n }\n}\n//# sourceMappingURL=webgpuShaderProcessorsWGSL.js.map","import { ILog2 } from \"../../Maths/math.scalar.functions\";\nimport { WebGPUTextureHelper } from \"./webgpuTextureHelper\";\n/** @internal */\nexport class WebGPUHardwareTexture {\n get underlyingResource() {\n return this._webgpuTexture;\n }\n getMSAATexture(index) {\n return this._webgpuMSAATexture?.[index] ?? null;\n }\n setMSAATexture(texture, index) {\n if (!this._webgpuMSAATexture) {\n this._webgpuMSAATexture = [];\n }\n this._webgpuMSAATexture[index] = texture;\n }\n releaseMSAATexture(index) {\n if (this._webgpuMSAATexture) {\n if (index !== undefined) {\n this._engine._textureHelper.releaseTexture(this._webgpuMSAATexture[index]);\n delete this._webgpuMSAATexture[index];\n }\n else {\n for (const texture of this._webgpuMSAATexture) {\n this._engine._textureHelper.releaseTexture(texture);\n }\n this._webgpuMSAATexture = null;\n }\n }\n }\n constructor(_engine, existingTexture = null) {\n this._engine = _engine;\n /** @internal */\n this._originalFormatIsRGB = false;\n this.format = \"rgba8unorm\" /* WebGPUConstants.TextureFormat.RGBA8Unorm */;\n this.textureUsages = 0;\n this.textureAdditionalUsages = 0;\n this._webgpuTexture = existingTexture;\n this._webgpuMSAATexture = null;\n this.view = null;\n this.viewForWriting = null;\n }\n set(hardwareTexture) {\n this._webgpuTexture = hardwareTexture;\n }\n setUsage(_textureSource, generateMipMaps, is2DArray, isCube, is3D, width, height, depth) {\n let viewDimension = \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */;\n let arrayLayerCount = 1;\n if (isCube) {\n viewDimension = is2DArray ? \"cube-array\" /* WebGPUConstants.TextureViewDimension.CubeArray */ : \"cube\" /* WebGPUConstants.TextureViewDimension.Cube */;\n arrayLayerCount = 6 * (depth || 1);\n }\n else if (is3D) {\n viewDimension = \"3d\" /* WebGPUConstants.TextureViewDimension.E3d */;\n arrayLayerCount = 1;\n }\n else if (is2DArray) {\n viewDimension = \"2d-array\" /* WebGPUConstants.TextureViewDimension.E2dArray */;\n arrayLayerCount = depth;\n }\n const format = WebGPUTextureHelper.GetDepthFormatOnly(this.format);\n const aspect = WebGPUTextureHelper.HasDepthAndStencilAspects(this.format) ? \"depth-only\" /* WebGPUConstants.TextureAspect.DepthOnly */ : \"all\" /* WebGPUConstants.TextureAspect.All */;\n this.createView({\n label: `TextureView${is3D ? \"3D\" : isCube ? \"Cube\" : \"2D\"}${is2DArray ? \"_Array\" + arrayLayerCount : \"\"}_${width}x${height}_${generateMipMaps ? \"wmips\" : \"womips\"}_${this.format}_${viewDimension}`,\n format,\n dimension: viewDimension,\n mipLevelCount: generateMipMaps ? ILog2(Math.max(width, height)) + 1 : 1,\n baseArrayLayer: 0,\n baseMipLevel: 0,\n arrayLayerCount,\n aspect,\n });\n }\n createView(descriptor, createViewForWriting = false) {\n this.view = this._webgpuTexture.createView(descriptor);\n if (createViewForWriting && descriptor) {\n const saveNumMipMaps = descriptor.mipLevelCount;\n descriptor.mipLevelCount = 1;\n this.viewForWriting = this._webgpuTexture.createView(descriptor);\n descriptor.mipLevelCount = saveNumMipMaps;\n }\n }\n reset() {\n this._webgpuTexture = null;\n this._webgpuMSAATexture = null;\n this.view = null;\n this.viewForWriting = null;\n }\n release() {\n this._webgpuTexture?.destroy();\n this.releaseMSAATexture();\n this._copyInvertYTempTexture?.destroy();\n this.reset();\n }\n}\n//# sourceMappingURL=webgpuHardwareTexture.js.map","/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-disable babylonjs/available */\n/* eslint-disable jsdoc/require-jsdoc */\n// License for the mipmap generation code:\n//\n// Copyright 2020 Brandon Jones\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\nimport * as WebGPUConstants from \"./webgpuConstants\";\nimport { Constants } from \"../constants\";\nimport { WebGPUHardwareTexture } from \"./webgpuHardwareTexture\";\nimport { WebGPUTextureHelper } from \"./webgpuTextureHelper\";\nimport { Finalize, Initialize, Process } from \"../Processors/shaderProcessor\";\n// TODO WEBGPU improve mipmap generation by using compute shaders\nconst mipmapVertexSource = `\r\n const pos = array<vec2<f32>, 4>( vec2f(-1.0f, 1.0f), vec2f(1.0f, 1.0f), vec2f(-1.0f, -1.0f), vec2f(1.0f, -1.0f));\r\n const tex = array<vec2<f32>, 4>( vec2f(0.0f, 0.0f), vec2f(1.0f, 0.0f), vec2f(0.0f, 1.0f), vec2f(1.0f, 1.0f));\r\n\r\n varying vTex: vec2f;\r\n\r\n @vertex\r\n fn main(input : VertexInputs) -> FragmentInputs {\r\n vertexOutputs.vTex = tex[input.vertexIndex];\r\n vertexOutputs.position = vec4f(pos[input.vertexIndex], 0.0, 1.0);\r\n }\r\n `;\nconst mipmapFragmentSource = `\r\n var imgSampler: sampler;\r\n var img: texture_2d<f32>;\r\n\r\n varying vTex: vec2f;\r\n\r\n @fragment\r\n fn main(input: FragmentInputs) -> FragmentOutputs {\r\n fragmentOutputs.color = textureSample(img, imgSampler, input.vTex);\r\n }\r\n `;\nconst invertYPreMultiplyAlphaVertexSource = `\r\n const pos = array<vec2<f32>, 4>( vec2f(-1.0f, 1.0f), vec2f(1.0f, 1.0f), vec2f(-1.0f, -1.0f), vec2f(1.0f, -1.0f));\r\n const tex = array<vec2<f32>, 4>( vec2f(0.0f, 0.0f), vec2f(1.0f, 0.0f), vec2f(0.0f, 1.0f), vec2f(1.0f, 1.0f));\r\n\r\n var img: texture_2d<f32>;\r\n\r\n #ifdef INVERTY\r\n varying vTextureSize: vec2f;\r\n #endif\r\n\r\n @vertex\r\n fn main(input : VertexInputs) -> FragmentInputs {\r\n #ifdef INVERTY\r\n vertexOutputs.vTextureSize = vec2f(textureDimensions(img, 0));\r\n #endif\r\n vertexOutputs.position = vec4f(pos[input.vertexIndex], 0.0, 1.0);\r\n }\r\n `;\nconst invertYPreMultiplyAlphaFragmentSource = `\r\n var img: texture_2d<f32>;\r\n\r\n #ifdef INVERTY\r\n varying vTextureSize: vec2f;\r\n #endif\r\n\r\n @fragment\r\n fn main(input: FragmentInputs) -> FragmentOutputs {\r\n #ifdef INVERTY\r\n var color: vec4f = textureLoad(img, vec2i(i32(input.position.x), i32(input.vTextureSize.y - input.position.y)), 0);\r\n #else\r\n var color: vec4f = textureLoad(img, vec2i(input.position.xy), 0);\r\n #endif\r\n #ifdef PREMULTIPLYALPHA\r\n fragmentOutputs.color = vec4f(color.rgb * color.a, color.a);\r\n #endif\r\n fragmentOutputs.color = color;\r\n }\r\n `;\nconst invertYPreMultiplyAlphaWithOfstVertexSource = invertYPreMultiplyAlphaVertexSource;\nconst invertYPreMultiplyAlphaWithOfstFragmentSource = `\r\n var img: texture_2d<f32>;\r\n uniform ofstX: f32;\r\n uniform ofstY: f32;\r\n uniform width: f32;\r\n uniform height: f32;\r\n\r\n #ifdef INVERTY\r\n varying vTextureSize: vec2f;\r\n #endif\r\n\r\n @fragment\r\n fn main(input: FragmentInputs) -> FragmentOutputs {\r\n if (input.position.x < uniforms.ofstX || input.position.x >= uniforms.ofstX + uniforms.width) {\r\n discard;\r\n }\r\n if (input.position.y < uniforms.ofstY || input.position.y >= uniforms.ofstY + uniforms.height) {\r\n discard;\r\n }\r\n #ifdef INVERTY\r\n var color: vec4f = textureLoad(img, vec2i(i32(input.position.x), i32(uniforms.ofstY + uniforms.height - (input.position.y - uniforms.ofstY))), 0);\r\n #else\r\n var color: vec4f = textureLoad(img, vec2i(input.position.xy), 0);\r\n #endif\r\n #ifdef PREMULTIPLYALPHA\r\n color = vec4f(color.rgb * color.a, color.a);\r\n #endif\r\n fragmentOutputs.color = color;\r\n }\r\n `;\nconst clearVertexSource = `\r\n const pos = array<vec2<f32>, 4>( vec2f(-1.0f, 1.0f), vec2f(1.0f, 1.0f), vec2f(-1.0f, -1.0f), vec2f(1.0f, -1.0f));\r\n\r\n @vertex\r\n fn main(input : VertexInputs) -> FragmentInputs {\r\n vertexOutputs.position = vec4f(pos[input.vertexIndex], 0.0, 1.0);\r\n }\r\n `;\nconst clearFragmentSource = `\r\n uniform color: vec4f;\r\n\r\n\r\n @fragment\r\n fn main(input: FragmentInputs) -> FragmentOutputs {\r\n fragmentOutputs.color = uniforms.color;\r\n }\r\n `;\nconst copyVideoToTextureVertexSource = `\r\n struct VertexOutput {\r\n @builtin(position) Position : vec4<f32>,\r\n @location(0) fragUV : vec2<f32>\r\n }\r\n\r\n @vertex\r\n fn main(\r\n @builtin(vertex_index) VertexIndex : u32\r\n ) -> VertexOutput {\r\n var pos = array<vec2<f32>, 4>(\r\n vec2(-1.0, 1.0),\r\n vec2( 1.0, 1.0),\r\n vec2(-1.0, -1.0),\r\n vec2( 1.0, -1.0)\r\n );\r\n var tex = array<vec2<f32>, 4>(\r\n vec2(0.0, 0.0),\r\n vec2(1.0, 0.0),\r\n vec2(0.0, 1.0),\r\n vec2(1.0, 1.0)\r\n );\r\n\r\n var output: VertexOutput;\r\n\r\n output.Position = vec4<f32>(pos[VertexIndex], 0.0, 1.0);\r\n output.fragUV = tex[VertexIndex];\r\n\r\n return output;\r\n }\r\n `;\nconst copyVideoToTextureFragmentSource = `\r\n @group(0) @binding(0) var videoSampler: sampler;\r\n @group(0) @binding(1) var videoTexture: texture_external;\r\n\r\n @fragment\r\n fn main(\r\n @location(0) fragUV: vec2<f32>\r\n ) -> @location(0) vec4<f32> {\r\n return textureSampleBaseClampToEdge(videoTexture, videoSampler, fragUV);\r\n }\r\n `;\nconst copyVideoToTextureInvertYFragmentSource = `\r\n @group(0) @binding(0) var videoSampler: sampler;\r\n @group(0) @binding(1) var videoTexture: texture_external;\r\n\r\n @fragment\r\n fn main(\r\n @location(0) fragUV: vec2<f32>\r\n ) -> @location(0) vec4<f32> {\r\n return textureSampleBaseClampToEdge(videoTexture, videoSampler, vec2<f32>(fragUV.x, 1.0 - fragUV.y));\r\n }\r\n `;\nvar PipelineType;\n(function (PipelineType) {\n PipelineType[PipelineType[\"MipMap\"] = 0] = \"MipMap\";\n PipelineType[PipelineType[\"InvertYPremultiplyAlpha\"] = 1] = \"InvertYPremultiplyAlpha\";\n PipelineType[PipelineType[\"Clear\"] = 2] = \"Clear\";\n PipelineType[PipelineType[\"InvertYPremultiplyAlphaWithOfst\"] = 3] = \"InvertYPremultiplyAlphaWithOfst\";\n})(PipelineType || (PipelineType = {}));\nvar VideoPipelineType;\n(function (VideoPipelineType) {\n VideoPipelineType[VideoPipelineType[\"DontInvertY\"] = 0] = \"DontInvertY\";\n VideoPipelineType[VideoPipelineType[\"InvertY\"] = 1] = \"InvertY\";\n})(VideoPipelineType || (VideoPipelineType = {}));\nconst shadersForPipelineType = [\n { vertex: mipmapVertexSource, fragment: mipmapFragmentSource },\n { vertex: invertYPreMultiplyAlphaVertexSource, fragment: invertYPreMultiplyAlphaFragmentSource },\n { vertex: clearVertexSource, fragment: clearFragmentSource },\n { vertex: invertYPreMultiplyAlphaWithOfstVertexSource, fragment: invertYPreMultiplyAlphaWithOfstFragmentSource },\n];\n/**\n * Map a (renderable) texture format (GPUTextureFormat) to an index for fast lookup (in caches for eg)\n * The number of entries should not go over 64! Else, the code in WebGPUCacheRenderPipeline.setMRT should be updated\n */\nexport const renderableTextureFormatToIndex = {\n \"\": 0,\n r8unorm: 1,\n r8uint: 2,\n r8sint: 3,\n r16uint: 4,\n r16sint: 5,\n r16float: 6,\n rg8unorm: 7,\n rg8uint: 8,\n rg8sint: 9,\n r32uint: 10,\n r32sint: 11,\n r32float: 12,\n rg16uint: 13,\n rg16sint: 14,\n rg16float: 15,\n rgba8unorm: 16,\n \"rgba8unorm-srgb\": 17,\n rgba8uint: 18,\n rgba8sint: 19,\n bgra8unorm: 20,\n \"bgra8unorm-srgb\": 21,\n rgb10a2uint: 22,\n rgb10a2unorm: 23,\n /* rg11b10ufloat: this entry is dynamically added if the \"RG11B10UFloatRenderable\" extension is supported */\n rg32uint: 24,\n rg32sint: 25,\n rg32float: 26,\n rgba16uint: 27,\n rgba16sint: 28,\n rgba16float: 29,\n rgba32uint: 30,\n rgba32sint: 31,\n rgba32float: 32,\n stencil8: 33,\n depth16unorm: 34,\n depth24plus: 35,\n \"depth24plus-stencil8\": 36,\n depth32float: 37,\n \"depth32float-stencil8\": 38,\n r16unorm: 39,\n rg16unorm: 40,\n rgba16unorm: 41,\n r16snorm: 42,\n rg16snorm: 43,\n rgba16snorm: 44,\n};\n/** @internal */\nexport class WebGPUTextureManager {\n //------------------------------------------------------------------------------\n // Initialization / Helpers\n //------------------------------------------------------------------------------\n constructor(engine, device, bufferManager, enabledExtensions) {\n this._pipelines = {};\n this._compiledShaders = [];\n this._videoPipelines = {};\n this._videoCompiledShaders = [];\n this._deferredReleaseTextures = [];\n this._engine = engine;\n this._device = device;\n this._bufferManager = bufferManager;\n if (enabledExtensions.indexOf(\"rg11b10ufloat-renderable\" /* WebGPUConstants.FeatureName.RG11B10UFloatRenderable */) !== -1) {\n const keys = Object.keys(renderableTextureFormatToIndex);\n renderableTextureFormatToIndex[\"rg11b10ufloat\" /* WebGPUConstants.TextureFormat.RG11B10UFloat */] = renderableTextureFormatToIndex[keys[keys.length - 1]] + 1;\n }\n this._mipmapSampler = device.createSampler({ minFilter: \"linear\" /* WebGPUConstants.FilterMode.Linear */ });\n this._videoSampler = device.createSampler({ minFilter: \"linear\" /* WebGPUConstants.FilterMode.Linear */ });\n this._ubCopyWithOfst = this._bufferManager.createBuffer(4 * 4, WebGPUConstants.BufferUsage.Uniform | WebGPUConstants.BufferUsage.CopyDst, \"UBCopyWithOffset\").underlyingResource;\n this._getPipeline(\"rgba8unorm\" /* WebGPUConstants.TextureFormat.RGBA8Unorm */);\n this._getVideoPipeline(\"rgba8unorm\" /* WebGPUConstants.TextureFormat.RGBA8Unorm */);\n }\n _getPipeline(format, type = PipelineType.MipMap, params) {\n const index = type === PipelineType.MipMap\n ? 1 << 0\n : type === PipelineType.InvertYPremultiplyAlpha\n ? ((params.invertY ? 1 : 0) << 1) + ((params.premultiplyAlpha ? 1 : 0) << 2)\n : type === PipelineType.Clear\n ? 1 << 3\n : type === PipelineType.InvertYPremultiplyAlphaWithOfst\n ? ((params.invertY ? 1 : 0) << 4) + ((params.premultiplyAlpha ? 1 : 0) << 5)\n : 0;\n if (!this._pipelines[format]) {\n this._pipelines[format] = [];\n }\n let pipelineAndBGL = this._pipelines[format][index];\n if (!pipelineAndBGL) {\n let defines = \"\";\n if (type === PipelineType.InvertYPremultiplyAlpha || type === PipelineType.InvertYPremultiplyAlphaWithOfst) {\n if (params.invertY) {\n defines += \"#define INVERTY\\n\";\n }\n if (params.premultiplyAlpha) {\n defines += \"#define PREMULTIPLYALPHA\\n\";\n }\n }\n let modules = this._compiledShaders[index];\n if (!modules) {\n let vertexCode = shadersForPipelineType[type].vertex;\n let fragmentCode = shadersForPipelineType[type].fragment;\n const processorOptions = {\n defines: defines.split(\"\\n\"),\n indexParameters: null,\n isFragment: false,\n shouldUseHighPrecisionShader: true,\n processor: this._engine._getShaderProcessor(1 /* ShaderLanguage.WGSL */),\n supportsUniformBuffers: true,\n shadersRepository: \"\",\n includesShadersStore: {},\n version: (this._engine.version * 100).toString(),\n platformName: this._engine.shaderPlatformName,\n processingContext: this._engine._getShaderProcessingContext(1 /* ShaderLanguage.WGSL */, true),\n isNDCHalfZRange: this._engine.isNDCHalfZRange,\n useReverseDepthBuffer: this._engine.useReverseDepthBuffer,\n };\n Initialize(processorOptions);\n // Disable special additions not needed here\n processorOptions.processor.pureMode = true;\n Process(vertexCode, processorOptions, (migratedVertexCode) => {\n vertexCode = migratedVertexCode;\n }, this._engine);\n processorOptions.isFragment = true;\n Process(fragmentCode, processorOptions, (migratedFragmentCode) => {\n fragmentCode = migratedFragmentCode;\n }, this._engine);\n const final = Finalize(vertexCode, fragmentCode, processorOptions);\n // Restore\n processorOptions.processor.pureMode = false;\n const vertexModule = this._device.createShaderModule({\n code: final.vertexCode,\n });\n const fragmentModule = this._device.createShaderModule({\n code: final.fragmentCode,\n });\n modules = this._compiledShaders[index] = [vertexModule, fragmentModule];\n }\n const pipeline = this._device.createRenderPipeline({\n layout: \"auto\" /* WebGPUConstants.AutoLayoutMode.Auto */,\n vertex: {\n module: modules[0],\n entryPoint: \"main\",\n },\n fragment: {\n module: modules[1],\n entryPoint: \"main\",\n targets: [\n {\n format,\n },\n ],\n },\n primitive: {\n topology: \"triangle-strip\" /* WebGPUConstants.PrimitiveTopology.TriangleStrip */,\n stripIndexFormat: \"uint16\" /* WebGPUConstants.IndexFormat.Uint16 */,\n },\n });\n pipelineAndBGL = this._pipelines[format][index] = [pipeline, pipeline.getBindGroupLayout(0)];\n }\n return pipelineAndBGL;\n }\n _getVideoPipeline(format, type = VideoPipelineType.DontInvertY) {\n const index = type === VideoPipelineType.InvertY ? 1 << 0 : 0;\n if (!this._videoPipelines[format]) {\n this._videoPipelines[format] = [];\n }\n let pipelineAndBGL = this._videoPipelines[format][index];\n if (!pipelineAndBGL) {\n let modules = this._videoCompiledShaders[index];\n if (!modules) {\n const vertexModule = this._device.createShaderModule({\n code: copyVideoToTextureVertexSource,\n });\n const fragmentModule = this._device.createShaderModule({\n code: index === 0 ? copyVideoToTextureFragmentSource : copyVideoToTextureInvertYFragmentSource,\n });\n modules = this._videoCompiledShaders[index] = [vertexModule, fragmentModule];\n }\n const pipeline = this._device.createRenderPipeline({\n label: `BabylonWebGPUDevice${this._engine.uniqueId}_CopyVideoToTexture_${format}_${index === 0 ? \"DontInvertY\" : \"InvertY\"}`,\n layout: \"auto\" /* WebGPUConstants.AutoLayoutMode.Auto */,\n vertex: {\n module: modules[0],\n entryPoint: \"main\",\n },\n fragment: {\n module: modules[1],\n entryPoint: \"main\",\n targets: [\n {\n format,\n },\n ],\n },\n primitive: {\n topology: \"triangle-strip\" /* WebGPUConstants.PrimitiveTopology.TriangleStrip */,\n stripIndexFormat: \"uint16\" /* WebGPUConstants.IndexFormat.Uint16 */,\n },\n });\n pipelineAndBGL = this._videoPipelines[format][index] = [pipeline, pipeline.getBindGroupLayout(0)];\n }\n return pipelineAndBGL;\n }\n setCommandEncoder(encoder) {\n this._commandEncoderForCreation = encoder;\n }\n copyVideoToTexture(video, texture, format, invertY = false, commandEncoder) {\n const useOwnCommandEncoder = commandEncoder === undefined;\n const [pipeline, bindGroupLayout] = this._getVideoPipeline(format, invertY ? VideoPipelineType.InvertY : VideoPipelineType.DontInvertY);\n if (useOwnCommandEncoder) {\n commandEncoder = this._device.createCommandEncoder({});\n }\n commandEncoder.pushDebugGroup?.(`copy video to texture - invertY=${invertY}`);\n const webgpuHardwareTexture = texture._hardwareTexture;\n const renderPassDescriptor = {\n label: `BabylonWebGPUDevice${this._engine.uniqueId}_copyVideoToTexture_${format}_${invertY ? \"InvertY\" : \"DontInvertY\"}${texture.label ? \"_\" + texture.label : \"\"}`,\n colorAttachments: [\n {\n view: webgpuHardwareTexture.underlyingResource.createView({\n format,\n dimension: \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */,\n mipLevelCount: 1,\n baseArrayLayer: 0,\n baseMipLevel: 0,\n arrayLayerCount: 1,\n aspect: \"all\" /* WebGPUConstants.TextureAspect.All */,\n }),\n loadOp: \"load\" /* WebGPUConstants.LoadOp.Load */,\n storeOp: \"store\" /* WebGPUConstants.StoreOp.Store */,\n },\n ],\n };\n const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);\n const descriptor = {\n layout: bindGroupLayout,\n entries: [\n {\n binding: 0,\n resource: this._videoSampler,\n },\n {\n binding: 1,\n resource: this._device.importExternalTexture({\n source: video.underlyingResource,\n }),\n },\n ],\n };\n const bindGroup = this._device.createBindGroup(descriptor);\n passEncoder.setPipeline(pipeline);\n passEncoder.setBindGroup(0, bindGroup);\n passEncoder.draw(4, 1, 0, 0);\n passEncoder.end();\n commandEncoder.popDebugGroup?.();\n if (useOwnCommandEncoder) {\n this._device.queue.submit([commandEncoder.finish()]);\n commandEncoder = null;\n }\n }\n invertYPreMultiplyAlpha(gpuOrHdwTexture, width, height, format, invertY = false, premultiplyAlpha = false, faceIndex = 0, mipLevel = 0, layers = 1, ofstX = 0, ofstY = 0, rectWidth = 0, rectHeight = 0, commandEncoder, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n allowGPUOptimization) {\n const useRect = rectWidth !== 0;\n const useOwnCommandEncoder = commandEncoder === undefined;\n const [pipeline, bindGroupLayout] = this._getPipeline(format, useRect ? PipelineType.InvertYPremultiplyAlphaWithOfst : PipelineType.InvertYPremultiplyAlpha, {\n invertY,\n premultiplyAlpha,\n });\n faceIndex = Math.max(faceIndex, 0);\n if (useOwnCommandEncoder) {\n commandEncoder = this._device.createCommandEncoder({});\n }\n commandEncoder.pushDebugGroup?.(`internal process texture - invertY=${invertY} premultiplyAlpha=${premultiplyAlpha}`);\n let gpuTexture;\n if (WebGPUTextureHelper.IsHardwareTexture(gpuOrHdwTexture)) {\n gpuTexture = gpuOrHdwTexture.underlyingResource;\n if (!(invertY && !premultiplyAlpha && layers === 1 && faceIndex === 0)) {\n // we optimize only for the most likely case (invertY=true, premultiplyAlpha=false, layers=1, faceIndex=0) to avoid dealing with big caches\n gpuOrHdwTexture = undefined;\n }\n }\n else {\n gpuTexture = gpuOrHdwTexture;\n gpuOrHdwTexture = undefined;\n }\n if (!gpuTexture) {\n return;\n }\n if (useRect) {\n this._bufferManager.setRawData(this._ubCopyWithOfst, 0, new Float32Array([ofstX, ofstY, rectWidth, rectHeight]), 0, 4 * 4);\n }\n const webgpuHardwareTexture = gpuOrHdwTexture;\n const outputTexture = webgpuHardwareTexture?._copyInvertYTempTexture ??\n this.createTexture({ width, height, layers: 1 }, false, false, false, false, false, format, 1, commandEncoder, 1 /* WebGPUConstants.TextureUsage.CopySrc */ | 16 /* WebGPUConstants.TextureUsage.RenderAttachment */ | 4 /* WebGPUConstants.TextureUsage.TextureBinding */, undefined, \"TempTextureForCopyWithInvertY\");\n const renderPassDescriptor = webgpuHardwareTexture?._copyInvertYRenderPassDescr ?? {\n label: `BabylonWebGPUDevice${this._engine.uniqueId}_invertYPreMultiplyAlpha_${format}_${invertY ? \"InvertY\" : \"DontInvertY\"}_${premultiplyAlpha ? \"PremultiplyAlpha\" : \"DontPremultiplyAlpha\"}`,\n colorAttachments: [\n {\n view: outputTexture.createView({\n format,\n dimension: \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */,\n baseMipLevel: 0,\n mipLevelCount: 1,\n arrayLayerCount: 1,\n baseArrayLayer: 0,\n }),\n loadOp: \"load\" /* WebGPUConstants.LoadOp.Load */,\n storeOp: \"store\" /* WebGPUConstants.StoreOp.Store */,\n },\n ],\n };\n const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);\n let bindGroup = useRect ? webgpuHardwareTexture?._copyInvertYBindGroupWithOfst : webgpuHardwareTexture?._copyInvertYBindGroup;\n if (!bindGroup) {\n const descriptor = {\n layout: bindGroupLayout,\n entries: [\n {\n binding: 0,\n resource: gpuTexture.createView({\n format,\n dimension: \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */,\n baseMipLevel: mipLevel,\n mipLevelCount: 1,\n arrayLayerCount: layers,\n baseArrayLayer: faceIndex,\n }),\n },\n ],\n };\n if (useRect) {\n descriptor.entries.push({\n binding: 1,\n resource: {\n buffer: this._ubCopyWithOfst,\n },\n });\n }\n bindGroup = this._device.createBindGroup(descriptor);\n }\n passEncoder.setPipeline(pipeline);\n passEncoder.setBindGroup(0, bindGroup);\n passEncoder.draw(4, 1, 0, 0);\n passEncoder.end();\n commandEncoder.copyTextureToTexture({\n texture: outputTexture,\n }, {\n texture: gpuTexture,\n mipLevel,\n origin: {\n x: 0,\n y: 0,\n z: faceIndex,\n },\n }, {\n width,\n height,\n depthOrArrayLayers: 1,\n });\n if (webgpuHardwareTexture) {\n webgpuHardwareTexture._copyInvertYTempTexture = outputTexture;\n webgpuHardwareTexture._copyInvertYRenderPassDescr = renderPassDescriptor;\n if (useRect) {\n webgpuHardwareTexture._copyInvertYBindGroupWithOfst = bindGroup;\n }\n else {\n webgpuHardwareTexture._copyInvertYBindGroup = bindGroup;\n }\n }\n else {\n this._deferredReleaseTextures.push([outputTexture, null]);\n }\n commandEncoder.popDebugGroup?.();\n if (useOwnCommandEncoder) {\n this._device.queue.submit([commandEncoder.finish()]);\n commandEncoder = null;\n }\n }\n copyWithInvertY(srcTextureView, format, renderPassDescriptor, commandEncoder) {\n const useOwnCommandEncoder = commandEncoder === undefined;\n const [pipeline, bindGroupLayout] = this._getPipeline(format, PipelineType.InvertYPremultiplyAlpha, { invertY: true, premultiplyAlpha: false });\n if (useOwnCommandEncoder) {\n commandEncoder = this._device.createCommandEncoder({});\n }\n commandEncoder.pushDebugGroup?.(`internal copy texture with invertY`);\n const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);\n const bindGroup = this._device.createBindGroup({\n layout: bindGroupLayout,\n entries: [\n {\n binding: 0,\n resource: srcTextureView,\n },\n ],\n });\n passEncoder.setPipeline(pipeline);\n passEncoder.setBindGroup(0, bindGroup);\n passEncoder.draw(4, 1, 0, 0);\n passEncoder.end();\n commandEncoder.popDebugGroup?.();\n if (useOwnCommandEncoder) {\n this._device.queue.submit([commandEncoder.finish()]);\n commandEncoder = null;\n }\n }\n //------------------------------------------------------------------------------\n // Creation\n //------------------------------------------------------------------------------\n createTexture(imageBitmap, hasMipmaps = false, generateMipmaps = false, invertY = false, premultiplyAlpha = false, is3D = false, format = \"rgba8unorm\" /* WebGPUConstants.TextureFormat.RGBA8Unorm */, sampleCount = 1, commandEncoder, usage = -1, additionalUsages = 0, label) {\n sampleCount = WebGPUTextureHelper.GetSample(sampleCount);\n const layerCount = imageBitmap.layers || 1;\n const textureSize = {\n width: imageBitmap.width,\n height: imageBitmap.height,\n depthOrArrayLayers: layerCount,\n };\n const renderAttachmentFlag = renderableTextureFormatToIndex[format] ? 16 /* WebGPUConstants.TextureUsage.RenderAttachment */ : 0;\n const isCompressedFormat = WebGPUTextureHelper.IsCompressedFormat(format);\n const mipLevelCount = hasMipmaps ? WebGPUTextureHelper.ComputeNumMipmapLevels(imageBitmap.width, imageBitmap.height) : 1;\n const usages = usage >= 0 ? usage : 1 /* WebGPUConstants.TextureUsage.CopySrc */ | 2 /* WebGPUConstants.TextureUsage.CopyDst */ | 4 /* WebGPUConstants.TextureUsage.TextureBinding */;\n additionalUsages |= hasMipmaps && !isCompressedFormat ? 1 /* WebGPUConstants.TextureUsage.CopySrc */ | renderAttachmentFlag : 0;\n if (!isCompressedFormat && !is3D) {\n // we don't know in advance if the texture will be updated with copyExternalImageToTexture (which requires to have those flags), so we need to force the flags all the times\n additionalUsages |= renderAttachmentFlag | 2 /* WebGPUConstants.TextureUsage.CopyDst */;\n }\n const gpuTexture = this._device.createTexture({\n label: `BabylonWebGPUDevice${this._engine.uniqueId}_Texture${is3D ? \"3D\" : \"2D\"}_${label ? label + \"_\" : \"\"}${textureSize.width}x${textureSize.height}x${textureSize.depthOrArrayLayers}_${hasMipmaps ? \"wmips\" : \"womips\"}_${format}_samples${sampleCount}`,\n size: textureSize,\n dimension: is3D ? \"3d\" /* WebGPUConstants.TextureDimension.E3d */ : \"2d\" /* WebGPUConstants.TextureDimension.E2d */,\n format,\n usage: usages | additionalUsages,\n sampleCount,\n mipLevelCount,\n });\n if (WebGPUTextureHelper.IsImageBitmap(imageBitmap)) {\n this.updateTexture(imageBitmap, gpuTexture, imageBitmap.width, imageBitmap.height, layerCount, format, 0, 0, invertY, premultiplyAlpha, 0, 0);\n if (hasMipmaps && generateMipmaps) {\n this.generateMipmaps(gpuTexture, format, mipLevelCount, 0, is3D, commandEncoder);\n }\n }\n return gpuTexture;\n }\n createCubeTexture(imageBitmaps, hasMipmaps = false, generateMipmaps = false, invertY = false, premultiplyAlpha = false, format = \"rgba8unorm\" /* WebGPUConstants.TextureFormat.RGBA8Unorm */, sampleCount = 1, commandEncoder, usage = -1, additionalUsages = 0, label) {\n sampleCount = WebGPUTextureHelper.GetSample(sampleCount);\n const width = WebGPUTextureHelper.IsImageBitmapArray(imageBitmaps) ? imageBitmaps[0].width : imageBitmaps.width;\n const height = WebGPUTextureHelper.IsImageBitmapArray(imageBitmaps) ? imageBitmaps[0].height : imageBitmaps.height;\n const renderAttachmentFlag = renderableTextureFormatToIndex[format] ? 16 /* WebGPUConstants.TextureUsage.RenderAttachment */ : 0;\n const isCompressedFormat = WebGPUTextureHelper.IsCompressedFormat(format);\n const mipLevelCount = hasMipmaps ? WebGPUTextureHelper.ComputeNumMipmapLevels(width, height) : 1;\n const usages = usage >= 0 ? usage : 1 /* WebGPUConstants.TextureUsage.CopySrc */ | 2 /* WebGPUConstants.TextureUsage.CopyDst */ | 4 /* WebGPUConstants.TextureUsage.TextureBinding */;\n additionalUsages |= hasMipmaps && !isCompressedFormat ? 1 /* WebGPUConstants.TextureUsage.CopySrc */ | renderAttachmentFlag : 0;\n if (!isCompressedFormat) {\n // we don't know in advance if the texture will be updated with copyExternalImageToTexture (which requires to have those flags), so we need to force the flags all the times\n additionalUsages |= renderAttachmentFlag | 2 /* WebGPUConstants.TextureUsage.CopyDst */;\n }\n const gpuTexture = this._device.createTexture({\n label: `BabylonWebGPUDevice${this._engine.uniqueId}_TextureCube_${label ? label + \"_\" : \"\"}${width}x${height}x6_${hasMipmaps ? \"wmips\" : \"womips\"}_${format}_samples${sampleCount}`,\n size: {\n width,\n height,\n depthOrArrayLayers: 6,\n },\n dimension: \"2d\" /* WebGPUConstants.TextureDimension.E2d */,\n format,\n usage: usages | additionalUsages,\n sampleCount,\n mipLevelCount,\n });\n if (WebGPUTextureHelper.IsImageBitmapArray(imageBitmaps)) {\n this.updateCubeTextures(imageBitmaps, gpuTexture, width, height, format, invertY, premultiplyAlpha, 0, 0);\n if (hasMipmaps && generateMipmaps) {\n this.generateCubeMipmaps(gpuTexture, format, mipLevelCount, commandEncoder);\n }\n }\n return gpuTexture;\n }\n generateCubeMipmaps(gpuTexture, format, mipLevelCount, commandEncoder) {\n const useOwnCommandEncoder = commandEncoder === undefined;\n if (useOwnCommandEncoder) {\n commandEncoder = this._device.createCommandEncoder({});\n }\n commandEncoder.pushDebugGroup?.(`create cube mipmaps - ${mipLevelCount} levels`);\n for (let f = 0; f < 6; ++f) {\n this.generateMipmaps(gpuTexture, format, mipLevelCount, f, false, commandEncoder);\n }\n commandEncoder.popDebugGroup?.();\n if (useOwnCommandEncoder) {\n this._device.queue.submit([commandEncoder.finish()]);\n commandEncoder = null;\n }\n }\n generateMipmaps(gpuOrHdwTexture, format, mipLevelCount, faceIndex = 0, is3D = false, commandEncoder) {\n const useOwnCommandEncoder = commandEncoder === undefined;\n const [pipeline, bindGroupLayout] = this._getPipeline(format);\n faceIndex = Math.max(faceIndex, 0);\n if (useOwnCommandEncoder) {\n commandEncoder = this._device.createCommandEncoder({});\n }\n commandEncoder.pushDebugGroup?.(`create mipmaps for face #${faceIndex} - ${mipLevelCount} levels`);\n let gpuTexture;\n if (WebGPUTextureHelper.IsHardwareTexture(gpuOrHdwTexture)) {\n gpuTexture = gpuOrHdwTexture.underlyingResource;\n gpuOrHdwTexture._mipmapGenRenderPassDescr = gpuOrHdwTexture._mipmapGenRenderPassDescr || [];\n gpuOrHdwTexture._mipmapGenBindGroup = gpuOrHdwTexture._mipmapGenBindGroup || [];\n }\n else {\n gpuTexture = gpuOrHdwTexture;\n gpuOrHdwTexture = undefined;\n }\n if (!gpuTexture) {\n return;\n }\n const webgpuHardwareTexture = gpuOrHdwTexture;\n for (let i = 1; i < mipLevelCount; ++i) {\n const renderPassDescriptor = webgpuHardwareTexture?._mipmapGenRenderPassDescr[faceIndex]?.[i - 1] ?? {\n label: `BabylonWebGPUDevice${this._engine.uniqueId}_generateMipmaps_${format}_faceIndex${faceIndex}_level${i}`,\n colorAttachments: [\n {\n view: gpuTexture.createView({\n format,\n dimension: is3D ? \"3d\" /* WebGPUConstants.TextureViewDimension.E3d */ : \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */,\n baseMipLevel: i,\n mipLevelCount: 1,\n arrayLayerCount: 1,\n baseArrayLayer: faceIndex,\n }),\n loadOp: \"load\" /* WebGPUConstants.LoadOp.Load */,\n storeOp: \"store\" /* WebGPUConstants.StoreOp.Store */,\n },\n ],\n };\n if (webgpuHardwareTexture) {\n webgpuHardwareTexture._mipmapGenRenderPassDescr[faceIndex] = webgpuHardwareTexture._mipmapGenRenderPassDescr[faceIndex] || [];\n webgpuHardwareTexture._mipmapGenRenderPassDescr[faceIndex][i - 1] = renderPassDescriptor;\n }\n const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);\n const bindGroup = webgpuHardwareTexture?._mipmapGenBindGroup[faceIndex]?.[i - 1] ??\n this._device.createBindGroup({\n layout: bindGroupLayout,\n entries: [\n {\n binding: 0,\n resource: gpuTexture.createView({\n format,\n dimension: is3D ? \"3d\" /* WebGPUConstants.TextureViewDimension.E3d */ : \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */,\n baseMipLevel: i - 1,\n mipLevelCount: 1,\n arrayLayerCount: 1,\n baseArrayLayer: faceIndex,\n }),\n },\n {\n binding: 1,\n resource: this._mipmapSampler,\n },\n ],\n });\n if (webgpuHardwareTexture) {\n webgpuHardwareTexture._mipmapGenBindGroup[faceIndex] = webgpuHardwareTexture._mipmapGenBindGroup[faceIndex] || [];\n webgpuHardwareTexture._mipmapGenBindGroup[faceIndex][i - 1] = bindGroup;\n }\n passEncoder.setPipeline(pipeline);\n passEncoder.setBindGroup(0, bindGroup);\n passEncoder.draw(4, 1, 0, 0);\n passEncoder.end();\n }\n commandEncoder.popDebugGroup?.();\n if (useOwnCommandEncoder) {\n this._device.queue.submit([commandEncoder.finish()]);\n commandEncoder = null;\n }\n }\n createGPUTextureForInternalTexture(texture, width, height, depth, creationFlags, dontCreateMSAATexture) {\n if (!texture._hardwareTexture) {\n texture._hardwareTexture = new WebGPUHardwareTexture(this._engine);\n }\n if (width === undefined) {\n width = texture.width;\n }\n if (height === undefined) {\n height = texture.height;\n }\n if (depth === undefined) {\n depth = texture.depth;\n }\n const gpuTextureWrapper = texture._hardwareTexture;\n const isStorageTexture = ((creationFlags ?? 0) & Constants.TEXTURE_CREATIONFLAG_STORAGE) !== 0;\n gpuTextureWrapper.format = WebGPUTextureHelper.GetWebGPUTextureFormat(texture.type, texture.format, texture._useSRGBBuffer);\n gpuTextureWrapper.textureUsages =\n texture._source === 5 /* InternalTextureSource.RenderTarget */ || texture.source === 6 /* InternalTextureSource.MultiRenderTarget */\n ? 4 /* WebGPUConstants.TextureUsage.TextureBinding */ | 1 /* WebGPUConstants.TextureUsage.CopySrc */ | 16 /* WebGPUConstants.TextureUsage.RenderAttachment */\n : texture._source === 12 /* InternalTextureSource.DepthStencil */\n ? 4 /* WebGPUConstants.TextureUsage.TextureBinding */ | 16 /* WebGPUConstants.TextureUsage.RenderAttachment */\n : -1;\n gpuTextureWrapper.textureAdditionalUsages = isStorageTexture ? 8 /* WebGPUConstants.TextureUsage.StorageBinding */ : 0;\n const hasMipMaps = texture.generateMipMaps;\n const layerCount = depth || 1;\n let mipmapCount;\n if (texture._maxLodLevel !== null) {\n mipmapCount = texture._maxLodLevel;\n }\n else {\n mipmapCount = hasMipMaps ? WebGPUTextureHelper.ComputeNumMipmapLevels(width, height) : 1;\n }\n if (texture.isCube) {\n const gpuTexture = this.createCubeTexture({ width, height }, texture.generateMipMaps, texture.generateMipMaps, texture.invertY, false, gpuTextureWrapper.format, 1, this._commandEncoderForCreation, gpuTextureWrapper.textureUsages, gpuTextureWrapper.textureAdditionalUsages, texture.label);\n gpuTextureWrapper.set(gpuTexture);\n const arrayLayerCount = texture.is3D ? 1 : layerCount;\n const format = WebGPUTextureHelper.GetDepthFormatOnly(gpuTextureWrapper.format);\n const aspect = WebGPUTextureHelper.HasDepthAndStencilAspects(gpuTextureWrapper.format) ? \"depth-only\" /* WebGPUConstants.TextureAspect.DepthOnly */ : \"all\" /* WebGPUConstants.TextureAspect.All */;\n const dimension = texture.is2DArray ? \"cube-array\" /* WebGPUConstants.TextureViewDimension.CubeArray */ : \"cube\" /* WebGPUConstants.TextureViewDimension.Cube */;\n gpuTextureWrapper.createView({\n label: `BabylonWebGPUDevice${this._engine.uniqueId}_TextureViewCube${texture.is2DArray ? \"_Array\" + arrayLayerCount : \"\"}_${width}x${height}_${hasMipMaps ? \"wmips\" : \"womips\"}_${format}_${dimension}_${aspect}_${texture.label ?? \"noname\"}`,\n format,\n dimension,\n mipLevelCount: mipmapCount,\n baseArrayLayer: 0,\n baseMipLevel: 0,\n arrayLayerCount: 6,\n aspect,\n }, isStorageTexture);\n }\n else {\n const gpuTexture = this.createTexture({ width, height, layers: layerCount }, texture.generateMipMaps, texture.generateMipMaps, texture.invertY, false, texture.is3D, gpuTextureWrapper.format, 1, this._commandEncoderForCreation, gpuTextureWrapper.textureUsages, gpuTextureWrapper.textureAdditionalUsages, texture.label);\n gpuTextureWrapper.set(gpuTexture);\n const arrayLayerCount = texture.is3D ? 1 : layerCount;\n const format = WebGPUTextureHelper.GetDepthFormatOnly(gpuTextureWrapper.format);\n const aspect = WebGPUTextureHelper.HasDepthAndStencilAspects(gpuTextureWrapper.format) ? \"depth-only\" /* WebGPUConstants.TextureAspect.DepthOnly */ : \"all\" /* WebGPUConstants.TextureAspect.All */;\n const dimension = texture.is2DArray\n ? \"2d-array\" /* WebGPUConstants.TextureViewDimension.E2dArray */\n : texture.is3D\n ? \"3d\" /* WebGPUConstants.TextureDimension.E3d */\n : \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */;\n gpuTextureWrapper.createView({\n label: `BabylonWebGPUDevice${this._engine.uniqueId}_TextureView${texture.is3D ? \"3D\" : \"2D\"}${texture.is2DArray ? \"_Array\" + arrayLayerCount : \"\"}_${width}x${height}${texture.is3D ? \"x\" + layerCount : \"\"}_${hasMipMaps ? \"wmips\" : \"womips\"}_${format}_${dimension}_${aspect}_${texture.label ?? \"noname\"}`,\n format,\n dimension,\n mipLevelCount: mipmapCount,\n baseArrayLayer: 0,\n baseMipLevel: 0,\n arrayLayerCount,\n aspect,\n }, isStorageTexture);\n }\n texture.width = texture.baseWidth = width;\n texture.height = texture.baseHeight = height;\n texture.depth = texture.baseDepth = depth;\n if (!dontCreateMSAATexture) {\n this.createMSAATexture(texture, texture.samples);\n }\n return gpuTextureWrapper;\n }\n createMSAATexture(texture, samples, releaseExisting = true, index = 0) {\n const gpuTextureWrapper = texture._hardwareTexture;\n if (releaseExisting) {\n gpuTextureWrapper?.releaseMSAATexture();\n }\n if (!gpuTextureWrapper || (samples ?? 1) <= 1) {\n return;\n }\n const width = texture.width;\n const height = texture.height;\n const gpuMSAATexture = this.createTexture({ width, height, layers: 1 }, false, false, false, false, false, gpuTextureWrapper.format, samples, this._commandEncoderForCreation, 16 /* WebGPUConstants.TextureUsage.RenderAttachment */, 0, texture.label ? \"MSAA_\" + texture.label : \"MSAA\");\n gpuTextureWrapper.setMSAATexture(gpuMSAATexture, index);\n }\n //------------------------------------------------------------------------------\n // Update\n //------------------------------------------------------------------------------\n updateCubeTextures(imageBitmaps, gpuTexture, width, height, format, invertY = false, premultiplyAlpha = false, offsetX = 0, offsetY = 0) {\n const faces = [0, 3, 1, 4, 2, 5];\n for (let f = 0; f < faces.length; ++f) {\n const imageBitmap = imageBitmaps[faces[f]];\n this.updateTexture(imageBitmap, gpuTexture, width, height, 1, format, f, 0, invertY, premultiplyAlpha, offsetX, offsetY);\n }\n }\n // TODO WEBGPU handle data source not being in the same format than the destination texture?\n updateTexture(imageBitmap, texture, width, height, layers, format, faceIndex = 0, mipLevel = 0, invertY = false, premultiplyAlpha = false, offsetX = 0, offsetY = 0, allowGPUOptimization) {\n const gpuTexture = WebGPUTextureHelper.IsInternalTexture(texture) ? texture._hardwareTexture.underlyingResource : texture;\n const blockInformation = WebGPUTextureHelper.GetBlockInformationFromFormat(format);\n const gpuOrHdwTexture = WebGPUTextureHelper.IsInternalTexture(texture) ? texture._hardwareTexture : texture;\n const textureCopyView = {\n texture: gpuTexture,\n origin: {\n x: offsetX,\n y: offsetY,\n z: Math.max(faceIndex, 0),\n },\n mipLevel: mipLevel,\n premultipliedAlpha: premultiplyAlpha,\n };\n const textureExtent = {\n width: Math.ceil(width / blockInformation.width) * blockInformation.width,\n height: Math.ceil(height / blockInformation.height) * blockInformation.height,\n depthOrArrayLayers: layers || 1,\n };\n if (imageBitmap.byteLength !== undefined) {\n imageBitmap = imageBitmap;\n const bytesPerRow = Math.ceil(width / blockInformation.width) * blockInformation.length;\n const aligned = Math.ceil(bytesPerRow / 256) * 256 === bytesPerRow;\n if (aligned) {\n const commandEncoder = this._device.createCommandEncoder({});\n const buffer = this._bufferManager.createRawBuffer(imageBitmap.byteLength, WebGPUConstants.BufferUsage.MapWrite | WebGPUConstants.BufferUsage.CopySrc, true, \"TempBufferForUpdateTexture\" + (gpuTexture ? \"_\" + gpuTexture.label : \"\"));\n const arrayBuffer = buffer.getMappedRange();\n new Uint8Array(arrayBuffer).set(imageBitmap);\n buffer.unmap();\n commandEncoder.copyBufferToTexture({\n buffer: buffer,\n offset: 0,\n bytesPerRow,\n rowsPerImage: height,\n }, textureCopyView, textureExtent);\n this._device.queue.submit([commandEncoder.finish()]);\n this._bufferManager.releaseBuffer(buffer);\n }\n else {\n this._device.queue.writeTexture(textureCopyView, imageBitmap, {\n offset: 0,\n bytesPerRow,\n rowsPerImage: height,\n }, textureExtent);\n }\n if (invertY || premultiplyAlpha) {\n if (WebGPUTextureHelper.IsInternalTexture(texture)) {\n const dontUseRect = offsetX === 0 && offsetY === 0 && width === texture.width && height === texture.height;\n this.invertYPreMultiplyAlpha(gpuOrHdwTexture, texture.width, texture.height, format, invertY, premultiplyAlpha, faceIndex, mipLevel, layers || 1, offsetX, offsetY, dontUseRect ? 0 : width, dontUseRect ? 0 : height, undefined, allowGPUOptimization);\n }\n else {\n // we should never take this code path\n // eslint-disable-next-line no-throw-literal\n throw \"updateTexture: Can't process the texture data because a GPUTexture was provided instead of an InternalTexture!\";\n }\n }\n }\n else {\n imageBitmap = imageBitmap;\n if (invertY) {\n textureCopyView.premultipliedAlpha = false; // we are going to handle premultiplyAlpha ourselves\n // we must preprocess the image\n if (WebGPUTextureHelper.IsInternalTexture(texture) && offsetX === 0 && offsetY === 0 && width === texture.width && height === texture.height) {\n // optimization when the source image is the same size than the destination texture and offsets X/Y == 0:\n // we simply copy the source to the destination and we apply the preprocessing on the destination\n this._device.queue.copyExternalImageToTexture({ source: imageBitmap }, textureCopyView, textureExtent);\n this.invertYPreMultiplyAlpha(gpuOrHdwTexture, width, height, format, invertY, premultiplyAlpha, faceIndex, mipLevel, layers || 1, 0, 0, 0, 0, undefined, allowGPUOptimization);\n }\n else {\n // we must apply the preprocessing on the source image before copying it into the destination texture\n const commandEncoder = this._device.createCommandEncoder({});\n // create a temp texture and copy the image to it\n const srcTexture = this.createTexture({ width, height, layers: 1 }, false, false, false, false, false, format, 1, commandEncoder, 1 /* WebGPUConstants.TextureUsage.CopySrc */ | 4 /* WebGPUConstants.TextureUsage.TextureBinding */, undefined, \"TempTextureForUpdateTexture\");\n this._deferredReleaseTextures.push([srcTexture, null]);\n textureExtent.depthOrArrayLayers = 1;\n this._device.queue.copyExternalImageToTexture({ source: imageBitmap }, { texture: srcTexture }, textureExtent);\n textureExtent.depthOrArrayLayers = layers || 1;\n // apply the preprocessing to this temp texture\n this.invertYPreMultiplyAlpha(srcTexture, width, height, format, invertY, premultiplyAlpha, faceIndex, mipLevel, layers || 1, 0, 0, 0, 0, commandEncoder, allowGPUOptimization);\n // copy the temp texture to the destination texture\n commandEncoder.copyTextureToTexture({ texture: srcTexture }, textureCopyView, textureExtent);\n this._device.queue.submit([commandEncoder.finish()]);\n }\n }\n else {\n // no preprocessing: direct copy to destination texture\n this._device.queue.copyExternalImageToTexture({ source: imageBitmap }, textureCopyView, textureExtent);\n }\n }\n }\n readPixels(texture, x, y, width, height, format, faceIndex = 0, mipLevel = 0, buffer = null, noDataConversion = false) {\n const blockInformation = WebGPUTextureHelper.GetBlockInformationFromFormat(format);\n const bytesPerRow = Math.ceil(width / blockInformation.width) * blockInformation.length;\n const bytesPerRowAligned = Math.ceil(bytesPerRow / 256) * 256;\n const size = bytesPerRowAligned * height;\n const gpuBuffer = this._bufferManager.createRawBuffer(size, WebGPUConstants.BufferUsage.MapRead | WebGPUConstants.BufferUsage.CopyDst, undefined, \"TempBufferForReadPixels\" + (texture.label ? \"_\" + texture.label : \"\"));\n const commandEncoder = this._device.createCommandEncoder({});\n commandEncoder.copyTextureToBuffer({\n texture,\n mipLevel,\n origin: {\n x,\n y,\n z: Math.max(faceIndex, 0),\n },\n }, {\n buffer: gpuBuffer,\n offset: 0,\n bytesPerRow: bytesPerRowAligned,\n }, {\n width,\n height,\n depthOrArrayLayers: 1,\n });\n this._device.queue.submit([commandEncoder.finish()]);\n return this._bufferManager.readDataFromBuffer(gpuBuffer, size, width, height, bytesPerRow, bytesPerRowAligned, WebGPUTextureHelper.GetTextureTypeFromFormat(format), 0, buffer, true, noDataConversion);\n }\n //------------------------------------------------------------------------------\n // Dispose\n //------------------------------------------------------------------------------\n releaseTexture(texture) {\n if (WebGPUTextureHelper.IsInternalTexture(texture)) {\n const hardwareTexture = texture._hardwareTexture;\n const irradianceTexture = texture._irradianceTexture;\n // We can't destroy the objects just now because they could be used in the current frame - we delay the destroying after the end of the frame\n this._deferredReleaseTextures.push([hardwareTexture, irradianceTexture]);\n }\n else {\n this._deferredReleaseTextures.push([texture, null]);\n }\n }\n destroyDeferredTextures() {\n for (let i = 0; i < this._deferredReleaseTextures.length; ++i) {\n const [hardwareTexture, irradianceTexture] = this._deferredReleaseTextures[i];\n if (hardwareTexture) {\n if (WebGPUTextureHelper.IsHardwareTexture(hardwareTexture)) {\n hardwareTexture.release();\n }\n else {\n hardwareTexture.destroy();\n }\n }\n irradianceTexture?.dispose();\n }\n this._deferredReleaseTextures.length = 0;\n }\n}\n//# sourceMappingURL=webgpuTextureManager.js.map","import { DataBuffer } from \"../../Buffers/dataBuffer\";\n/** @internal */\nexport class WebGPUDataBuffer extends DataBuffer {\n set buffer(buffer) {\n this._buffer = buffer;\n }\n constructor(resource, capacity = 0) {\n super();\n // Used to make sure the buffer is not recreated twice after a context loss/restoration\n this.engineId = -1;\n this.capacity = capacity;\n if (resource) {\n this._buffer = resource;\n }\n }\n get underlyingResource() {\n return this._buffer;\n }\n}\n//# sourceMappingURL=webgpuDataBuffer.js.map","import { WebGPUDataBuffer } from \"../../Meshes/WebGPU/webgpuDataBuffer\";\nimport { FromHalfFloat } from \"../../Misc/textureTools\";\nimport { allocateAndCopyTypedBuffer } from \"../abstractEngine.functions\";\nimport { Constants } from \"../constants\";\n// eslint-disable-next-line @typescript-eslint/naming-convention\nimport * as WebGPUConstants from \"./webgpuConstants\";\n/** @internal */\nexport class WebGPUBufferManager {\n static _IsGPUBuffer(buffer) {\n return buffer.underlyingResource === undefined;\n }\n static _FlagsToString(flags, suffix = \"\") {\n let result = suffix;\n for (let i = 0; i <= 9; ++i) {\n if (flags & (1 << i)) {\n if (result) {\n result += \"_\";\n }\n result += WebGPUConstants.BufferUsage[1 << i];\n }\n }\n return result;\n }\n constructor(engine, device) {\n this._deferredReleaseBuffers = [];\n this._engine = engine;\n this._device = device;\n }\n createRawBuffer(viewOrSize, flags, mappedAtCreation = false, label) {\n const alignedLength = viewOrSize.byteLength !== undefined ? (viewOrSize.byteLength + 3) & ~3 : (viewOrSize + 3) & ~3; // 4 bytes alignments (because of the upload which requires this)\n const verticesBufferDescriptor = {\n label: \"BabylonWebGPUDevice\" + this._engine.uniqueId + \"_\" + WebGPUBufferManager._FlagsToString(flags, label ?? \"Buffer\") + \"_size\" + alignedLength,\n mappedAtCreation,\n size: alignedLength,\n usage: flags,\n };\n return this._device.createBuffer(verticesBufferDescriptor);\n }\n createBuffer(viewOrSize, flags, label) {\n const isView = viewOrSize.byteLength !== undefined;\n const dataBuffer = new WebGPUDataBuffer();\n const labelId = \"DataBufferUniqueId=\" + dataBuffer.uniqueId;\n dataBuffer.buffer = this.createRawBuffer(viewOrSize, flags, undefined, label ? labelId + \"-\" + label : labelId);\n dataBuffer.references = 1;\n dataBuffer.capacity = isView ? viewOrSize.byteLength : viewOrSize;\n dataBuffer.engineId = this._engine.uniqueId;\n if (isView) {\n this.setSubData(dataBuffer, 0, viewOrSize);\n }\n return dataBuffer;\n }\n setRawData(buffer, dstByteOffset, src, srcByteOffset, byteLength) {\n this._device.queue.writeBuffer(buffer, dstByteOffset, src.buffer, srcByteOffset, byteLength);\n }\n setSubData(dataBuffer, dstByteOffset, src, srcByteOffset = 0, byteLength = 0) {\n const buffer = dataBuffer.underlyingResource;\n byteLength = byteLength || src.byteLength;\n byteLength = Math.min(byteLength, dataBuffer.capacity - dstByteOffset);\n // After Migration to Canary\n let chunkStart = src.byteOffset + srcByteOffset;\n let chunkEnd = chunkStart + byteLength;\n // 4 bytes alignments for upload\n const alignedLength = (byteLength + 3) & ~3;\n if (alignedLength !== byteLength) {\n const tempView = new Uint8Array(src.buffer.slice(chunkStart, chunkEnd));\n src = new Uint8Array(alignedLength);\n src.set(tempView);\n srcByteOffset = 0;\n chunkStart = 0;\n chunkEnd = alignedLength;\n byteLength = alignedLength;\n }\n // Chunk\n const maxChunk = 1024 * 1024 * 15;\n let offset = 0;\n while (chunkEnd - (chunkStart + offset) > maxChunk) {\n this._device.queue.writeBuffer(buffer, dstByteOffset + offset, src.buffer, chunkStart + offset, maxChunk);\n offset += maxChunk;\n }\n this._device.queue.writeBuffer(buffer, dstByteOffset + offset, src.buffer, chunkStart + offset, byteLength - offset);\n }\n _getHalfFloatAsFloatRGBAArrayBuffer(dataLength, arrayBuffer, destArray) {\n if (!destArray) {\n destArray = new Float32Array(dataLength);\n }\n const srcData = new Uint16Array(arrayBuffer);\n while (dataLength--) {\n destArray[dataLength] = FromHalfFloat(srcData[dataLength]);\n }\n return destArray;\n }\n readDataFromBuffer(gpuBuffer, size, width, height, bytesPerRow, bytesPerRowAligned, type = Constants.TEXTURETYPE_UNSIGNED_BYTE, offset = 0, buffer = null, destroyBuffer = true, noDataConversion = false) {\n const floatFormat = type === Constants.TEXTURETYPE_FLOAT ? 2 : type === Constants.TEXTURETYPE_HALF_FLOAT ? 1 : 0;\n const engineId = this._engine.uniqueId;\n return new Promise((resolve, reject) => {\n gpuBuffer.mapAsync(1 /* WebGPUConstants.MapMode.Read */, offset, size).then(() => {\n const copyArrayBuffer = gpuBuffer.getMappedRange(offset, size);\n let data = buffer;\n if (noDataConversion) {\n if (data === null) {\n data = allocateAndCopyTypedBuffer(type, size, true, copyArrayBuffer);\n }\n else {\n data = allocateAndCopyTypedBuffer(type, data.buffer, undefined, copyArrayBuffer);\n }\n }\n else {\n if (data === null) {\n switch (floatFormat) {\n case 0: // byte format\n data = new Uint8Array(size);\n data.set(new Uint8Array(copyArrayBuffer));\n break;\n case 1: // half float\n // TODO WEBGPU use computer shaders (or render pass) to make the conversion?\n data = this._getHalfFloatAsFloatRGBAArrayBuffer(size / 2, copyArrayBuffer);\n break;\n case 2: // float\n data = new Float32Array(size / 4);\n data.set(new Float32Array(copyArrayBuffer));\n break;\n }\n }\n else {\n switch (floatFormat) {\n case 0: // byte format\n data = new Uint8Array(data.buffer);\n data.set(new Uint8Array(copyArrayBuffer));\n break;\n case 1: // half float\n // TODO WEBGPU use computer shaders (or render pass) to make the conversion?\n data = this._getHalfFloatAsFloatRGBAArrayBuffer(size / 2, copyArrayBuffer, buffer);\n break;\n case 2: // float\n data = new Float32Array(data.buffer);\n data.set(new Float32Array(copyArrayBuffer));\n break;\n }\n }\n }\n if (bytesPerRow !== bytesPerRowAligned) {\n // TODO WEBGPU use computer shaders (or render pass) to build the final buffer data?\n if (floatFormat === 1 && !noDataConversion) {\n // half float have been converted to float above\n bytesPerRow *= 2;\n bytesPerRowAligned *= 2;\n }\n const data2 = new Uint8Array(data.buffer);\n let offset = bytesPerRow, offset2 = 0;\n for (let y = 1; y < height; ++y) {\n offset2 = y * bytesPerRowAligned;\n for (let x = 0; x < bytesPerRow; ++x) {\n data2[offset++] = data2[offset2++];\n }\n }\n if (floatFormat !== 0 && !noDataConversion) {\n data = new Float32Array(data2.buffer, 0, offset / 4);\n }\n else {\n data = new Uint8Array(data2.buffer, 0, offset);\n }\n }\n gpuBuffer.unmap();\n if (destroyBuffer) {\n this.releaseBuffer(gpuBuffer);\n }\n resolve(data);\n }, (reason) => {\n if (this._engine.isDisposed || this._engine.uniqueId !== engineId) {\n // The engine was disposed while waiting for the promise, or a context loss/restoration has occurred: don't reject\n resolve(new Uint8Array());\n }\n else {\n reject(reason);\n }\n });\n });\n }\n releaseBuffer(buffer) {\n if (WebGPUBufferManager._IsGPUBuffer(buffer)) {\n this._deferredReleaseBuffers.push(buffer);\n return true;\n }\n buffer.references--;\n if (buffer.references === 0) {\n this._deferredReleaseBuffers.push(buffer.underlyingResource);\n return true;\n }\n return false;\n }\n destroyDeferredBuffers() {\n for (let i = 0; i < this._deferredReleaseBuffers.length; ++i) {\n this._deferredReleaseBuffers[i].destroy();\n }\n this._deferredReleaseBuffers.length = 0;\n }\n}\n//# sourceMappingURL=webgpuBufferManager.js.map","import { Constants } from \"../constants\";\nconst filterToBits = [\n 0 | (0 << 1) | (0 << 2), // not used\n 0 | (0 << 1) | (0 << 2), // TEXTURE_NEAREST_SAMPLINGMODE / TEXTURE_NEAREST_NEAREST\n 1 | (1 << 1) | (0 << 2), // TEXTURE_BILINEAR_SAMPLINGMODE / TEXTURE_LINEAR_LINEAR\n 1 | (1 << 1) | (1 << 2), // TEXTURE_TRILINEAR_SAMPLINGMODE / TEXTURE_LINEAR_LINEAR_MIPLINEAR\n 0 | (0 << 1) | (0 << 2), // TEXTURE_NEAREST_NEAREST_MIPNEAREST\n 0 | (1 << 1) | (0 << 2), // TEXTURE_NEAREST_LINEAR_MIPNEAREST\n 0 | (1 << 1) | (1 << 2), // TEXTURE_NEAREST_LINEAR_MIPLINEAR\n 0 | (1 << 1) | (0 << 2), // TEXTURE_NEAREST_LINEAR\n 0 | (0 << 1) | (1 << 2), // TEXTURE_NEAREST_NEAREST_MIPLINEAR\n 1 | (0 << 1) | (0 << 2), // TEXTURE_LINEAR_NEAREST_MIPNEAREST\n 1 | (0 << 1) | (1 << 2), // TEXTURE_LINEAR_NEAREST_MIPLINEAR\n 1 | (1 << 1) | (0 << 2), // TEXTURE_LINEAR_LINEAR_MIPNEAREST\n 1 | (0 << 1) | (0 << 2), // TEXTURE_LINEAR_NEAREST\n];\n// subtract 0x01FF from the comparison function value before indexing this array!\nconst comparisonFunctionToBits = [\n (0 << 3) | (0 << 4) | (0 << 5) | (0 << 6), // undefined\n (0 << 3) | (0 << 4) | (0 << 5) | (1 << 6), // NEVER\n (0 << 3) | (0 << 4) | (1 << 5) | (0 << 6), // LESS\n (0 << 3) | (0 << 4) | (1 << 5) | (1 << 6), // EQUAL\n (0 << 3) | (1 << 4) | (0 << 5) | (0 << 6), // LEQUAL\n (0 << 3) | (1 << 4) | (0 << 5) | (1 << 6), // GREATER\n (0 << 3) | (1 << 4) | (1 << 5) | (0 << 6), // NOTEQUAL\n (0 << 3) | (1 << 4) | (1 << 5) | (1 << 6), // GEQUAL\n (1 << 3) | (0 << 4) | (0 << 5) | (0 << 6), // ALWAYS\n];\nconst filterNoMipToBits = [\n 0 << 7, // not used\n 1 << 7, // TEXTURE_NEAREST_SAMPLINGMODE / TEXTURE_NEAREST_NEAREST\n 1 << 7, // TEXTURE_BILINEAR_SAMPLINGMODE / TEXTURE_LINEAR_LINEAR\n 0 << 7, // TEXTURE_TRILINEAR_SAMPLINGMODE / TEXTURE_LINEAR_LINEAR_MIPLINEAR\n 0 << 7, // TEXTURE_NEAREST_NEAREST_MIPNEAREST\n 0 << 7, // TEXTURE_NEAREST_LINEAR_MIPNEAREST\n 0 << 7, // TEXTURE_NEAREST_LINEAR_MIPLINEAR\n 1 << 7, // TEXTURE_NEAREST_LINEAR\n 0 << 7, // TEXTURE_NEAREST_NEAREST_MIPLINEAR\n 0 << 7, // TEXTURE_LINEAR_NEAREST_MIPNEAREST\n 0 << 7, // TEXTURE_LINEAR_NEAREST_MIPLINEAR\n 0 << 7, // TEXTURE_LINEAR_LINEAR_MIPNEAREST\n 1 << 7, // TEXTURE_LINEAR_NEAREST\n];\n/** @internal */\nexport class WebGPUCacheSampler {\n constructor(device) {\n this._samplers = {};\n this._device = device;\n this.disabled = false;\n }\n static GetSamplerHashCode(sampler) {\n // The WebGPU spec currently only allows values 1 and 4 for anisotropy\n const anisotropy = sampler._cachedAnisotropicFilteringLevel ? sampler._cachedAnisotropicFilteringLevel : 1;\n const code = filterToBits[sampler.samplingMode] +\n comparisonFunctionToBits[(sampler._comparisonFunction || 0x0202) - 0x0200 + 1] +\n filterNoMipToBits[sampler.samplingMode] + // handle the lodMinClamp = lodMaxClamp = 0 case when no filter used for mip mapping\n ((sampler._cachedWrapU ?? 1) << 8) +\n ((sampler._cachedWrapV ?? 1) << 10) +\n ((sampler._cachedWrapR ?? 1) << 12) +\n ((sampler.useMipMaps ? 1 : 0) << 14) + // need to factor this in because _getSamplerFilterDescriptor depends on samplingMode AND useMipMaps!\n (anisotropy << 15);\n return code;\n }\n static _GetSamplerFilterDescriptor(sampler, anisotropy) {\n let magFilter, minFilter, mipmapFilter, lodMinClamp, lodMaxClamp;\n const useMipMaps = sampler.useMipMaps;\n switch (sampler.samplingMode) {\n case Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST:\n magFilter = \"linear\" /* WebGPUConstants.FilterMode.Linear */;\n minFilter = \"linear\" /* WebGPUConstants.FilterMode.Linear */;\n mipmapFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n if (!useMipMaps) {\n lodMinClamp = lodMaxClamp = 0;\n }\n break;\n case Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR:\n case Constants.TEXTURE_TRILINEAR_SAMPLINGMODE:\n magFilter = \"linear\" /* WebGPUConstants.FilterMode.Linear */;\n minFilter = \"linear\" /* WebGPUConstants.FilterMode.Linear */;\n if (!useMipMaps) {\n mipmapFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n lodMinClamp = lodMaxClamp = 0;\n }\n else {\n mipmapFilter = \"linear\" /* WebGPUConstants.FilterMode.Linear */;\n }\n break;\n case Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR:\n magFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n minFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n if (!useMipMaps) {\n mipmapFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n lodMinClamp = lodMaxClamp = 0;\n }\n else {\n mipmapFilter = \"linear\" /* WebGPUConstants.FilterMode.Linear */;\n }\n break;\n case Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST:\n magFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n minFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n mipmapFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n if (!useMipMaps) {\n lodMinClamp = lodMaxClamp = 0;\n }\n break;\n case Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST:\n magFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n minFilter = \"linear\" /* WebGPUConstants.FilterMode.Linear */;\n mipmapFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n if (!useMipMaps) {\n lodMinClamp = lodMaxClamp = 0;\n }\n break;\n case Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR:\n magFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n minFilter = \"linear\" /* WebGPUConstants.FilterMode.Linear */;\n if (!useMipMaps) {\n mipmapFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n lodMinClamp = lodMaxClamp = 0;\n }\n else {\n mipmapFilter = \"linear\" /* WebGPUConstants.FilterMode.Linear */;\n }\n break;\n case Constants.TEXTURE_NEAREST_LINEAR:\n magFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n minFilter = \"linear\" /* WebGPUConstants.FilterMode.Linear */;\n mipmapFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n lodMinClamp = lodMaxClamp = 0;\n break;\n case Constants.TEXTURE_NEAREST_NEAREST:\n case Constants.TEXTURE_NEAREST_SAMPLINGMODE:\n magFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n minFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n mipmapFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n lodMinClamp = lodMaxClamp = 0;\n break;\n case Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST:\n magFilter = \"linear\" /* WebGPUConstants.FilterMode.Linear */;\n minFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n mipmapFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n if (!useMipMaps) {\n lodMinClamp = lodMaxClamp = 0;\n }\n break;\n case Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR:\n magFilter = \"linear\" /* WebGPUConstants.FilterMode.Linear */;\n minFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n if (!useMipMaps) {\n mipmapFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n lodMinClamp = lodMaxClamp = 0;\n }\n else {\n mipmapFilter = \"linear\" /* WebGPUConstants.FilterMode.Linear */;\n }\n break;\n case Constants.TEXTURE_LINEAR_LINEAR:\n case Constants.TEXTURE_BILINEAR_SAMPLINGMODE:\n magFilter = \"linear\" /* WebGPUConstants.FilterMode.Linear */;\n minFilter = \"linear\" /* WebGPUConstants.FilterMode.Linear */;\n mipmapFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n lodMinClamp = lodMaxClamp = 0;\n break;\n case Constants.TEXTURE_LINEAR_NEAREST:\n magFilter = \"linear\" /* WebGPUConstants.FilterMode.Linear */;\n minFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n mipmapFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n lodMinClamp = lodMaxClamp = 0;\n break;\n default:\n magFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n minFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n mipmapFilter = \"nearest\" /* WebGPUConstants.FilterMode.Nearest */;\n lodMinClamp = lodMaxClamp = 0;\n break;\n }\n if (anisotropy > 1 && (lodMinClamp !== 0 || lodMaxClamp !== 0) && mipmapFilter !== \"nearest\" /* WebGPUConstants.FilterMode.Nearest */) {\n return {\n magFilter: \"linear\" /* WebGPUConstants.FilterMode.Linear */,\n minFilter: \"linear\" /* WebGPUConstants.FilterMode.Linear */,\n mipmapFilter: \"linear\" /* WebGPUConstants.FilterMode.Linear */,\n anisotropyEnabled: true,\n };\n }\n return {\n magFilter,\n minFilter,\n mipmapFilter,\n lodMinClamp,\n lodMaxClamp,\n };\n }\n static _GetWrappingMode(mode) {\n switch (mode) {\n case Constants.TEXTURE_WRAP_ADDRESSMODE:\n return \"repeat\" /* WebGPUConstants.AddressMode.Repeat */;\n case Constants.TEXTURE_CLAMP_ADDRESSMODE:\n return \"clamp-to-edge\" /* WebGPUConstants.AddressMode.ClampToEdge */;\n case Constants.TEXTURE_MIRROR_ADDRESSMODE:\n return \"mirror-repeat\" /* WebGPUConstants.AddressMode.MirrorRepeat */;\n }\n return \"repeat\" /* WebGPUConstants.AddressMode.Repeat */;\n }\n static _GetSamplerWrappingDescriptor(sampler) {\n return {\n addressModeU: this._GetWrappingMode(sampler._cachedWrapU),\n addressModeV: this._GetWrappingMode(sampler._cachedWrapV),\n addressModeW: this._GetWrappingMode(sampler._cachedWrapR),\n };\n }\n static _GetSamplerDescriptor(sampler, label) {\n const anisotropy = sampler.useMipMaps && sampler._cachedAnisotropicFilteringLevel ? sampler._cachedAnisotropicFilteringLevel : 1;\n const filterDescriptor = this._GetSamplerFilterDescriptor(sampler, anisotropy);\n return {\n label,\n ...filterDescriptor,\n ...this._GetSamplerWrappingDescriptor(sampler),\n compare: sampler._comparisonFunction ? WebGPUCacheSampler.GetCompareFunction(sampler._comparisonFunction) : undefined,\n maxAnisotropy: filterDescriptor.anisotropyEnabled ? anisotropy : 1,\n };\n }\n static GetCompareFunction(compareFunction) {\n switch (compareFunction) {\n case Constants.ALWAYS:\n return \"always\" /* WebGPUConstants.CompareFunction.Always */;\n case Constants.EQUAL:\n return \"equal\" /* WebGPUConstants.CompareFunction.Equal */;\n case Constants.GREATER:\n return \"greater\" /* WebGPUConstants.CompareFunction.Greater */;\n case Constants.GEQUAL:\n return \"greater-equal\" /* WebGPUConstants.CompareFunction.GreaterEqual */;\n case Constants.LESS:\n return \"less\" /* WebGPUConstants.CompareFunction.Less */;\n case Constants.LEQUAL:\n return \"less-equal\" /* WebGPUConstants.CompareFunction.LessEqual */;\n case Constants.NEVER:\n return \"never\" /* WebGPUConstants.CompareFunction.Never */;\n case Constants.NOTEQUAL:\n return \"not-equal\" /* WebGPUConstants.CompareFunction.NotEqual */;\n default:\n return \"less\" /* WebGPUConstants.CompareFunction.Less */;\n }\n }\n getSampler(sampler, bypassCache = false, hash = 0, label) {\n if (this.disabled) {\n return this._device.createSampler(WebGPUCacheSampler._GetSamplerDescriptor(sampler, label));\n }\n if (bypassCache) {\n hash = 0;\n }\n else if (hash === 0) {\n hash = WebGPUCacheSampler.GetSamplerHashCode(sampler);\n }\n let gpuSampler = bypassCache ? undefined : this._samplers[hash];\n if (!gpuSampler) {\n gpuSampler = this._device.createSampler(WebGPUCacheSampler._GetSamplerDescriptor(sampler, label));\n if (!bypassCache) {\n this._samplers[hash] = gpuSampler;\n }\n }\n return gpuSampler;\n }\n}\n//# sourceMappingURL=webgpuCacheSampler.js.map","import { VertexBuffer } from \"../Meshes/buffer\";\nconst vertexBufferKindForNonFloatProcessing = {\n [VertexBuffer.PositionKind]: true,\n [VertexBuffer.NormalKind]: true,\n [VertexBuffer.TangentKind]: true,\n [VertexBuffer.UVKind]: true,\n [VertexBuffer.UV2Kind]: true,\n [VertexBuffer.UV3Kind]: true,\n [VertexBuffer.UV4Kind]: true,\n [VertexBuffer.UV5Kind]: true,\n [VertexBuffer.UV6Kind]: true,\n [VertexBuffer.ColorKind]: true,\n [VertexBuffer.ColorInstanceKind]: true,\n [VertexBuffer.MatricesIndicesKind]: true,\n [VertexBuffer.MatricesWeightsKind]: true,\n [VertexBuffer.MatricesIndicesExtraKind]: true,\n [VertexBuffer.MatricesWeightsExtraKind]: true,\n};\n/**\n * Indicates if the type is a signed or unsigned type\n * @param type Type to check\n * @returns True if it is a signed type\n */\nfunction isSignedType(type) {\n switch (type) {\n case VertexBuffer.BYTE:\n case VertexBuffer.SHORT:\n case VertexBuffer.INT:\n case VertexBuffer.FLOAT:\n return true;\n case VertexBuffer.UNSIGNED_BYTE:\n case VertexBuffer.UNSIGNED_SHORT:\n case VertexBuffer.UNSIGNED_INT:\n return false;\n default:\n throw new Error(`Invalid type '${type}'`);\n }\n}\n/**\n * Checks whether some vertex buffers that should be of type float are of a different type (int, byte...).\n * If so, trigger a shader recompilation to give the shader processor the opportunity to update the code accordingly.\n * @param vertexBuffers List of vertex buffers to check\n * @param effect The effect (shaders) that should be recompiled if needed\n */\nexport function checkNonFloatVertexBuffers(vertexBuffers, effect) {\n const engine = effect.getEngine();\n const pipelineContext = effect._pipelineContext;\n if (!pipelineContext?.vertexBufferKindToType) {\n return;\n }\n let shaderProcessingContext = null;\n for (const kind in vertexBuffers) {\n const currentVertexBuffer = vertexBuffers[kind];\n if (!currentVertexBuffer || !vertexBufferKindForNonFloatProcessing[kind]) {\n continue;\n }\n const currentVertexBufferType = currentVertexBuffer.normalized ? VertexBuffer.FLOAT : currentVertexBuffer.type;\n const vertexBufferType = pipelineContext.vertexBufferKindToType[kind];\n if ((currentVertexBufferType !== VertexBuffer.FLOAT && vertexBufferType === undefined) ||\n (vertexBufferType !== undefined && vertexBufferType !== currentVertexBufferType)) {\n if (!shaderProcessingContext) {\n shaderProcessingContext = engine._getShaderProcessingContext(effect.shaderLanguage, false);\n }\n pipelineContext.vertexBufferKindToType[kind] = currentVertexBufferType;\n if (currentVertexBufferType !== VertexBuffer.FLOAT) {\n shaderProcessingContext.vertexBufferKindToNumberOfComponents[kind] = VertexBuffer.DeduceStride(kind);\n if (isSignedType(currentVertexBufferType)) {\n shaderProcessingContext.vertexBufferKindToNumberOfComponents[kind] *= -1;\n }\n }\n }\n }\n if (shaderProcessingContext) {\n // We temporarily disable parallel compilation of shaders because we want new shaders to be compiled after the _processShaderCode call, so that they are in effect for the rest of the frame.\n // There is no additional call to async so the _processShaderCodeAsync will execute synchronously.\n const parallelShaderCompile = engine._caps.parallelShaderCompile;\n engine._caps.parallelShaderCompile = undefined;\n effect._processShaderCodeAsync(null, engine._features._checkNonFloatVertexBuffersDontRecreatePipelineContext, shaderProcessingContext);\n engine._caps.parallelShaderCompile = parallelShaderCompile;\n }\n}\n//# sourceMappingURL=buffer.nonFloatVertexBuffers.js.map","/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-disable babylonjs/available */\n/* eslint-disable jsdoc/require-jsdoc */\nimport { Constants } from \"../constants\";\nimport { VertexBuffer } from \"../../Buffers/buffer\";\nimport { WebGPUTextureHelper } from \"./webgpuTextureHelper\";\nimport { renderableTextureFormatToIndex } from \"./webgpuTextureManager\";\nimport { checkNonFloatVertexBuffers } from \"core/Buffers/buffer.nonFloatVertexBuffers\";\nvar StatePosition;\n(function (StatePosition) {\n StatePosition[StatePosition[\"StencilReadMask\"] = 0] = \"StencilReadMask\";\n StatePosition[StatePosition[\"StencilWriteMask\"] = 1] = \"StencilWriteMask\";\n //DepthBiasClamp = 1, // not used, so remove it to improve perf\n StatePosition[StatePosition[\"DepthBias\"] = 2] = \"DepthBias\";\n StatePosition[StatePosition[\"DepthBiasSlopeScale\"] = 3] = \"DepthBiasSlopeScale\";\n StatePosition[StatePosition[\"DepthStencilState\"] = 4] = \"DepthStencilState\";\n StatePosition[StatePosition[\"MRTAttachments1\"] = 5] = \"MRTAttachments1\";\n StatePosition[StatePosition[\"MRTAttachments2\"] = 6] = \"MRTAttachments2\";\n StatePosition[StatePosition[\"RasterizationState\"] = 7] = \"RasterizationState\";\n StatePosition[StatePosition[\"ColorStates\"] = 8] = \"ColorStates\";\n StatePosition[StatePosition[\"ShaderStage\"] = 9] = \"ShaderStage\";\n StatePosition[StatePosition[\"TextureStage\"] = 10] = \"TextureStage\";\n StatePosition[StatePosition[\"VertexState\"] = 11] = \"VertexState\";\n StatePosition[StatePosition[\"NumStates\"] = 12] = \"NumStates\";\n})(StatePosition || (StatePosition = {}));\nconst alphaBlendFactorToIndex = {\n 0: 1, // Zero\n 1: 2, // One\n 0x0300: 3, // SrcColor\n 0x0301: 4, // OneMinusSrcColor\n 0x0302: 5, // SrcAlpha\n 0x0303: 6, // OneMinusSrcAlpha\n 0x0304: 7, // DstAlpha\n 0x0305: 8, // OneMinusDstAlpha\n 0x0306: 9, // DstColor\n 0x0307: 10, // OneMinusDstColor\n 0x0308: 11, // SrcAlphaSaturated\n 0x8001: 12, // BlendColor\n 0x8002: 13, // OneMinusBlendColor\n 0x8003: 12, // BlendColor (alpha)\n 0x8004: 13, // OneMinusBlendColor (alpha)\n};\nconst stencilOpToIndex = {\n 0x0000: 0, // ZERO\n 0x1e00: 1, // KEEP\n 0x1e01: 2, // REPLACE\n 0x1e02: 3, // INCR\n 0x1e03: 4, // DECR\n 0x150a: 5, // INVERT\n 0x8507: 6, // INCR_WRAP\n 0x8508: 7, // DECR_WRAP\n};\n/** @internal */\nexport class WebGPUCacheRenderPipeline {\n constructor(device, emptyVertexBuffer) {\n this.mrtTextureCount = 0;\n this._device = device;\n this._useTextureStage = true; // we force usage because we must handle depth textures with \"float\" filtering, which can't be fixed by a caps (like \"textureFloatLinearFiltering\" can for float textures)\n this._states = new Array(30); // pre-allocate enough room so that no new allocation will take place afterwards\n this._statesLength = 0;\n this._stateDirtyLowestIndex = 0;\n this._emptyVertexBuffer = emptyVertexBuffer;\n this._mrtFormats = [];\n this._parameter = { token: undefined, pipeline: null };\n this.disabled = false;\n this.vertexBuffers = [];\n this._kMaxVertexBufferStride = device.limits.maxVertexBufferArrayStride || 2048;\n this.reset();\n }\n reset() {\n this._isDirty = true;\n this.vertexBuffers.length = 0;\n this.setAlphaToCoverage(false);\n this.resetDepthCullingState();\n this.setClampDepth(false);\n this.setDepthBias(0);\n //this.setDepthBiasClamp(0);\n this._webgpuColorFormat = [\"bgra8unorm\" /* WebGPUConstants.TextureFormat.BGRA8Unorm */];\n this.setColorFormat(\"bgra8unorm\" /* WebGPUConstants.TextureFormat.BGRA8Unorm */);\n this.setMRT([]);\n this.setAlphaBlendEnabled(false);\n this.setAlphaBlendFactors([null, null, null, null], [null, null]);\n this.setWriteMask(0xf);\n this.setDepthStencilFormat(\"depth24plus-stencil8\" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */);\n this.setStencilEnabled(false);\n this.resetStencilState();\n this.setBuffers(null, null, null);\n this._setTextureState(0);\n }\n get colorFormats() {\n return this._mrtAttachments1 > 0 ? this._mrtFormats : this._webgpuColorFormat;\n }\n getRenderPipeline(fillMode, effect, sampleCount, textureState = 0) {\n sampleCount = WebGPUTextureHelper.GetSample(sampleCount);\n if (this.disabled) {\n const topology = WebGPUCacheRenderPipeline._GetTopology(fillMode);\n this._setVertexState(effect); // to fill this.vertexBuffers with correct data\n this._setTextureState(textureState);\n this._parameter.pipeline = this._createRenderPipeline(effect, topology, sampleCount);\n WebGPUCacheRenderPipeline.NumCacheMiss++;\n WebGPUCacheRenderPipeline._NumPipelineCreationCurrentFrame++;\n return this._parameter.pipeline;\n }\n this._setShaderStage(effect.uniqueId);\n this._setRasterizationState(fillMode, sampleCount);\n this._setColorStates();\n this._setDepthStencilState();\n this._setVertexState(effect);\n this._setTextureState(textureState);\n this.lastStateDirtyLowestIndex = this._stateDirtyLowestIndex;\n if (!this._isDirty && this._parameter.pipeline) {\n this._stateDirtyLowestIndex = this._statesLength;\n WebGPUCacheRenderPipeline.NumCacheHitWithoutHash++;\n return this._parameter.pipeline;\n }\n this._getRenderPipeline(this._parameter);\n this._isDirty = false;\n this._stateDirtyLowestIndex = this._statesLength;\n if (this._parameter.pipeline) {\n WebGPUCacheRenderPipeline.NumCacheHitWithHash++;\n return this._parameter.pipeline;\n }\n const topology = WebGPUCacheRenderPipeline._GetTopology(fillMode);\n this._parameter.pipeline = this._createRenderPipeline(effect, topology, sampleCount);\n this._setRenderPipeline(this._parameter);\n WebGPUCacheRenderPipeline.NumCacheMiss++;\n WebGPUCacheRenderPipeline._NumPipelineCreationCurrentFrame++;\n return this._parameter.pipeline;\n }\n endFrame() {\n WebGPUCacheRenderPipeline.NumPipelineCreationLastFrame = WebGPUCacheRenderPipeline._NumPipelineCreationCurrentFrame;\n WebGPUCacheRenderPipeline._NumPipelineCreationCurrentFrame = 0;\n }\n setAlphaToCoverage(enabled) {\n this._alphaToCoverageEnabled = enabled;\n }\n setFrontFace(frontFace) {\n this._frontFace = frontFace;\n }\n setCullEnabled(enabled) {\n this._cullEnabled = enabled;\n }\n setCullFace(cullFace) {\n this._cullFace = cullFace;\n }\n setClampDepth(clampDepth) {\n this._clampDepth = clampDepth;\n }\n resetDepthCullingState() {\n this.setDepthCullingState(false, 2, 1, 0, 0, true, true, Constants.ALWAYS);\n }\n setDepthCullingState(cullEnabled, frontFace, cullFace, zOffset, zOffsetUnits, depthTestEnabled, depthWriteEnabled, depthCompare) {\n this._depthWriteEnabled = depthWriteEnabled;\n this._depthTestEnabled = depthTestEnabled;\n this._depthCompare = (depthCompare ?? Constants.ALWAYS) - 0x0200;\n this._cullFace = cullFace;\n this._cullEnabled = cullEnabled;\n this._frontFace = frontFace;\n this.setDepthBiasSlopeScale(zOffset);\n this.setDepthBias(zOffsetUnits);\n }\n setDepthBias(depthBias) {\n if (this._depthBias !== depthBias) {\n this._depthBias = depthBias;\n this._states[StatePosition.DepthBias] = depthBias;\n this._isDirty = true;\n this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.DepthBias);\n }\n }\n /*public setDepthBiasClamp(depthBiasClamp: number): void {\n if (this._depthBiasClamp !== depthBiasClamp) {\n this._depthBiasClamp = depthBiasClamp;\n this._states[StatePosition.DepthBiasClamp] = depthBiasClamp.toString();\n this._isDirty = true;\n }\n }*/\n setDepthBiasSlopeScale(depthBiasSlopeScale) {\n if (this._depthBiasSlopeScale !== depthBiasSlopeScale) {\n this._depthBiasSlopeScale = depthBiasSlopeScale;\n this._states[StatePosition.DepthBiasSlopeScale] = depthBiasSlopeScale;\n this._isDirty = true;\n this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.DepthBiasSlopeScale);\n }\n }\n setColorFormat(format) {\n this._webgpuColorFormat[0] = format;\n this._colorFormat = renderableTextureFormatToIndex[format ?? \"\"];\n }\n setMRTAttachments(attachments) {\n this.mrtAttachments = attachments;\n let mask = 0;\n for (let i = 0; i < attachments.length; ++i) {\n if (attachments[i] !== 0) {\n mask += 1 << i;\n }\n }\n if (this._mrtEnabledMask !== mask) {\n this._mrtEnabledMask = mask;\n this._isDirty = true;\n this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.MRTAttachments1);\n }\n }\n setMRT(textureArray, textureCount) {\n textureCount = textureCount ?? textureArray.length;\n if (textureCount > 10) {\n // If we want more than 10 attachments we need to change this method (and the StatePosition enum) but 10 seems plenty: note that WebGPU only supports 8 at the time (2021/12/13)!\n // As we need ~39 different values we are using 6 bits to encode a texture format, meaning we can encode 5 texture formats in 32 bits\n // We are using 2x32 bit values to handle 10 textures\n // eslint-disable-next-line no-throw-literal\n throw \"Can't handle more than 10 attachments for a MRT in cache render pipeline!\";\n }\n this.mrtTextureArray = textureArray;\n this.mrtTextureCount = textureCount;\n this._mrtEnabledMask = 0xffff; // all textures are enabled at start (meaning we can write to them). Calls to setMRTAttachments may disable some\n const bits = [0, 0];\n let indexBits = 0, mask = 0, numRT = 0;\n for (let i = 0; i < textureCount; ++i) {\n const texture = textureArray[i];\n const gpuWrapper = texture?._hardwareTexture;\n this._mrtFormats[numRT] = gpuWrapper?.format ?? this._webgpuColorFormat[0];\n bits[indexBits] += renderableTextureFormatToIndex[this._mrtFormats[numRT] ?? \"\"] << mask;\n mask += 6;\n numRT++;\n if (mask >= 32) {\n mask = 0;\n indexBits++;\n }\n }\n this._mrtFormats.length = numRT;\n if (this._mrtAttachments1 !== bits[0] || this._mrtAttachments2 !== bits[1]) {\n this._mrtAttachments1 = bits[0];\n this._mrtAttachments2 = bits[1];\n this._states[StatePosition.MRTAttachments1] = bits[0];\n this._states[StatePosition.MRTAttachments2] = bits[1];\n this._isDirty = true;\n this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.MRTAttachments1);\n }\n }\n setAlphaBlendEnabled(enabled) {\n this._alphaBlendEnabled = enabled;\n }\n setAlphaBlendFactors(factors, operations) {\n this._alphaBlendFuncParams = factors;\n this._alphaBlendEqParams = operations;\n }\n setWriteMask(mask) {\n this._writeMask = mask;\n }\n setDepthStencilFormat(format) {\n this._webgpuDepthStencilFormat = format;\n this._depthStencilFormat = format === undefined ? 0 : renderableTextureFormatToIndex[format];\n }\n setDepthTestEnabled(enabled) {\n this._depthTestEnabled = enabled;\n }\n setDepthWriteEnabled(enabled) {\n this._depthWriteEnabled = enabled;\n }\n setDepthCompare(func) {\n this._depthCompare = (func ?? Constants.ALWAYS) - 0x0200;\n }\n setStencilEnabled(enabled) {\n this._stencilEnabled = enabled;\n }\n setStencilCompare(func) {\n this._stencilFrontCompare = (func ?? Constants.ALWAYS) - 0x0200;\n }\n setStencilDepthFailOp(op) {\n this._stencilFrontDepthFailOp = op === null ? 1 /* KEEP */ : stencilOpToIndex[op];\n }\n setStencilPassOp(op) {\n this._stencilFrontPassOp = op === null ? 2 /* REPLACE */ : stencilOpToIndex[op];\n }\n setStencilFailOp(op) {\n this._stencilFrontFailOp = op === null ? 1 /* KEEP */ : stencilOpToIndex[op];\n }\n setStencilReadMask(mask) {\n if (this._stencilReadMask !== mask) {\n this._stencilReadMask = mask;\n this._states[StatePosition.StencilReadMask] = mask;\n this._isDirty = true;\n this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.StencilReadMask);\n }\n }\n setStencilWriteMask(mask) {\n if (this._stencilWriteMask !== mask) {\n this._stencilWriteMask = mask;\n this._states[StatePosition.StencilWriteMask] = mask;\n this._isDirty = true;\n this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.StencilWriteMask);\n }\n }\n resetStencilState() {\n this.setStencilState(false, Constants.ALWAYS, Constants.KEEP, Constants.REPLACE, Constants.KEEP, 0xff, 0xff);\n }\n setStencilState(stencilEnabled, compare, depthFailOp, passOp, failOp, readMask, writeMask) {\n this._stencilEnabled = stencilEnabled;\n this._stencilFrontCompare = (compare ?? Constants.ALWAYS) - 0x0200;\n this._stencilFrontDepthFailOp = depthFailOp === null ? 1 /* KEEP */ : stencilOpToIndex[depthFailOp];\n this._stencilFrontPassOp = passOp === null ? 2 /* REPLACE */ : stencilOpToIndex[passOp];\n this._stencilFrontFailOp = failOp === null ? 1 /* KEEP */ : stencilOpToIndex[failOp];\n this.setStencilReadMask(readMask);\n this.setStencilWriteMask(writeMask);\n }\n setBuffers(vertexBuffers, indexBuffer, overrideVertexBuffers) {\n this._vertexBuffers = vertexBuffers;\n this._overrideVertexBuffers = overrideVertexBuffers;\n this._indexBuffer = indexBuffer;\n }\n static _GetTopology(fillMode) {\n switch (fillMode) {\n // Triangle views\n case Constants.MATERIAL_TriangleFillMode:\n return \"triangle-list\" /* WebGPUConstants.PrimitiveTopology.TriangleList */;\n case Constants.MATERIAL_PointFillMode:\n return \"point-list\" /* WebGPUConstants.PrimitiveTopology.PointList */;\n case Constants.MATERIAL_WireFrameFillMode:\n return \"line-list\" /* WebGPUConstants.PrimitiveTopology.LineList */;\n // Draw modes\n case Constants.MATERIAL_PointListDrawMode:\n return \"point-list\" /* WebGPUConstants.PrimitiveTopology.PointList */;\n case Constants.MATERIAL_LineListDrawMode:\n return \"line-list\" /* WebGPUConstants.PrimitiveTopology.LineList */;\n case Constants.MATERIAL_LineLoopDrawMode:\n // return this._gl.LINE_LOOP;\n // TODO WEBGPU. Line Loop Mode Fallback at buffer load time.\n // eslint-disable-next-line no-throw-literal\n throw \"LineLoop is an unsupported fillmode in WebGPU\";\n case Constants.MATERIAL_LineStripDrawMode:\n return \"line-strip\" /* WebGPUConstants.PrimitiveTopology.LineStrip */;\n case Constants.MATERIAL_TriangleStripDrawMode:\n return \"triangle-strip\" /* WebGPUConstants.PrimitiveTopology.TriangleStrip */;\n case Constants.MATERIAL_TriangleFanDrawMode:\n // return this._gl.TRIANGLE_FAN;\n // TODO WEBGPU. Triangle Fan Mode Fallback at buffer load time.\n // eslint-disable-next-line no-throw-literal\n throw \"TriangleFan is an unsupported fillmode in WebGPU\";\n default:\n return \"triangle-list\" /* WebGPUConstants.PrimitiveTopology.TriangleList */;\n }\n }\n static _GetAphaBlendOperation(operation) {\n switch (operation) {\n case Constants.GL_ALPHA_EQUATION_ADD:\n return \"add\" /* WebGPUConstants.BlendOperation.Add */;\n case Constants.GL_ALPHA_EQUATION_SUBTRACT:\n return \"subtract\" /* WebGPUConstants.BlendOperation.Subtract */;\n case Constants.GL_ALPHA_EQUATION_REVERSE_SUBTRACT:\n return \"reverse-subtract\" /* WebGPUConstants.BlendOperation.ReverseSubtract */;\n case Constants.GL_ALPHA_EQUATION_MIN:\n return \"min\" /* WebGPUConstants.BlendOperation.Min */;\n case Constants.GL_ALPHA_EQUATION_MAX:\n return \"max\" /* WebGPUConstants.BlendOperation.Max */;\n default:\n return \"add\" /* WebGPUConstants.BlendOperation.Add */;\n }\n }\n static _GetAphaBlendFactor(factor) {\n switch (factor) {\n case 0:\n return \"zero\" /* WebGPUConstants.BlendFactor.Zero */;\n case 1:\n return \"one\" /* WebGPUConstants.BlendFactor.One */;\n case Constants.GL_ALPHA_FUNCTION_SRC:\n return \"src\" /* WebGPUConstants.BlendFactor.Src */;\n case Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR:\n return \"one-minus-src\" /* WebGPUConstants.BlendFactor.OneMinusSrc */;\n case Constants.GL_ALPHA_FUNCTION_SRC_ALPHA:\n return \"src-alpha\" /* WebGPUConstants.BlendFactor.SrcAlpha */;\n case Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA:\n return \"one-minus-src-alpha\" /* WebGPUConstants.BlendFactor.OneMinusSrcAlpha */;\n case Constants.GL_ALPHA_FUNCTION_DST_ALPHA:\n return \"dst-alpha\" /* WebGPUConstants.BlendFactor.DstAlpha */;\n case Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_ALPHA:\n return \"one-minus-dst-alpha\" /* WebGPUConstants.BlendFactor.OneMinusDstAlpha */;\n case Constants.GL_ALPHA_FUNCTION_DST_COLOR:\n return \"dst\" /* WebGPUConstants.BlendFactor.Dst */;\n case Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_COLOR:\n return \"one-minus-dst\" /* WebGPUConstants.BlendFactor.OneMinusDst */;\n case Constants.GL_ALPHA_FUNCTION_SRC_ALPHA_SATURATED:\n return \"src-alpha-saturated\" /* WebGPUConstants.BlendFactor.SrcAlphaSaturated */;\n case Constants.GL_ALPHA_FUNCTION_CONSTANT_COLOR:\n return \"constant\" /* WebGPUConstants.BlendFactor.Constant */;\n case Constants.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_COLOR:\n return \"one-minus-constant\" /* WebGPUConstants.BlendFactor.OneMinusConstant */;\n case Constants.GL_ALPHA_FUNCTION_CONSTANT_ALPHA:\n return \"constant\" /* WebGPUConstants.BlendFactor.Constant */;\n case Constants.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_ALPHA:\n return \"one-minus-constant\" /* WebGPUConstants.BlendFactor.OneMinusConstant */;\n case Constants.GL_ALPHA_FUNCTION_SRC1_COLOR:\n return \"src1\" /* WebGPUConstants.BlendFactor.Src1 */;\n case Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC1_COLOR:\n return \"one-minus-src1\" /* WebGPUConstants.BlendFactor.OneMinusSrc1 */;\n case Constants.GL_ALPHA_FUNCTION_SRC1_ALPHA:\n return \"src1-alpha\" /* WebGPUConstants.BlendFactor.Src1Alpha */;\n case Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC1_ALPHA:\n return \"one-minus-src1-alpha\" /* WebGPUConstants.BlendFactor.OneMinusSrc1Alpha */;\n default:\n return \"one\" /* WebGPUConstants.BlendFactor.One */;\n }\n }\n static _GetCompareFunction(compareFunction) {\n switch (compareFunction) {\n case 0: // NEVER\n return \"never\" /* WebGPUConstants.CompareFunction.Never */;\n case 1: // LESS\n return \"less\" /* WebGPUConstants.CompareFunction.Less */;\n case 2: // EQUAL\n return \"equal\" /* WebGPUConstants.CompareFunction.Equal */;\n case 3: // LEQUAL\n return \"less-equal\" /* WebGPUConstants.CompareFunction.LessEqual */;\n case 4: // GREATER\n return \"greater\" /* WebGPUConstants.CompareFunction.Greater */;\n case 5: // NOTEQUAL\n return \"not-equal\" /* WebGPUConstants.CompareFunction.NotEqual */;\n case 6: // GEQUAL\n return \"greater-equal\" /* WebGPUConstants.CompareFunction.GreaterEqual */;\n case 7: // ALWAYS\n return \"always\" /* WebGPUConstants.CompareFunction.Always */;\n }\n return \"never\" /* WebGPUConstants.CompareFunction.Never */;\n }\n static _GetStencilOpFunction(operation) {\n switch (operation) {\n case 0:\n return \"zero\" /* WebGPUConstants.StencilOperation.Zero */;\n case 1:\n return \"keep\" /* WebGPUConstants.StencilOperation.Keep */;\n case 2:\n return \"replace\" /* WebGPUConstants.StencilOperation.Replace */;\n case 3:\n return \"increment-clamp\" /* WebGPUConstants.StencilOperation.IncrementClamp */;\n case 4:\n return \"decrement-clamp\" /* WebGPUConstants.StencilOperation.DecrementClamp */;\n case 5:\n return \"invert\" /* WebGPUConstants.StencilOperation.Invert */;\n case 6:\n return \"increment-wrap\" /* WebGPUConstants.StencilOperation.IncrementWrap */;\n case 7:\n return \"decrement-wrap\" /* WebGPUConstants.StencilOperation.DecrementWrap */;\n }\n return \"keep\" /* WebGPUConstants.StencilOperation.Keep */;\n }\n static _GetVertexInputDescriptorFormat(vertexBuffer) {\n const type = vertexBuffer.type;\n const normalized = vertexBuffer.normalized;\n const size = vertexBuffer.getSize();\n switch (type) {\n case VertexBuffer.BYTE:\n switch (size) {\n case 1:\n case 2:\n return normalized ? \"snorm8x2\" /* WebGPUConstants.VertexFormat.Snorm8x2 */ : \"sint8x2\" /* WebGPUConstants.VertexFormat.Sint8x2 */;\n case 3:\n case 4:\n return normalized ? \"snorm8x4\" /* WebGPUConstants.VertexFormat.Snorm8x4 */ : \"sint8x4\" /* WebGPUConstants.VertexFormat.Sint8x4 */;\n }\n break;\n case VertexBuffer.UNSIGNED_BYTE:\n switch (size) {\n case 1:\n case 2:\n return normalized ? \"unorm8x2\" /* WebGPUConstants.VertexFormat.Unorm8x2 */ : \"uint8x2\" /* WebGPUConstants.VertexFormat.Uint8x2 */;\n case 3:\n case 4:\n return normalized ? \"unorm8x4\" /* WebGPUConstants.VertexFormat.Unorm8x4 */ : \"uint8x4\" /* WebGPUConstants.VertexFormat.Uint8x4 */;\n }\n break;\n case VertexBuffer.SHORT:\n switch (size) {\n case 1:\n case 2:\n return normalized ? \"snorm16x2\" /* WebGPUConstants.VertexFormat.Snorm16x2 */ : \"sint16x2\" /* WebGPUConstants.VertexFormat.Sint16x2 */;\n case 3:\n case 4:\n return normalized ? \"snorm16x4\" /* WebGPUConstants.VertexFormat.Snorm16x4 */ : \"sint16x4\" /* WebGPUConstants.VertexFormat.Sint16x4 */;\n }\n break;\n case VertexBuffer.UNSIGNED_SHORT:\n switch (size) {\n case 1:\n case 2:\n return normalized ? \"unorm16x2\" /* WebGPUConstants.VertexFormat.Unorm16x2 */ : \"uint16x2\" /* WebGPUConstants.VertexFormat.Uint16x2 */;\n case 3:\n case 4:\n return normalized ? \"unorm16x4\" /* WebGPUConstants.VertexFormat.Unorm16x4 */ : \"uint16x4\" /* WebGPUConstants.VertexFormat.Uint16x4 */;\n }\n break;\n case VertexBuffer.INT:\n switch (size) {\n case 1:\n return \"sint32\" /* WebGPUConstants.VertexFormat.Sint32 */;\n case 2:\n return \"sint32x2\" /* WebGPUConstants.VertexFormat.Sint32x2 */;\n case 3:\n return \"sint32x3\" /* WebGPUConstants.VertexFormat.Sint32x3 */;\n case 4:\n return \"sint32x4\" /* WebGPUConstants.VertexFormat.Sint32x4 */;\n }\n break;\n case VertexBuffer.UNSIGNED_INT:\n switch (size) {\n case 1:\n return \"uint32\" /* WebGPUConstants.VertexFormat.Uint32 */;\n case 2:\n return \"uint32x2\" /* WebGPUConstants.VertexFormat.Uint32x2 */;\n case 3:\n return \"uint32x3\" /* WebGPUConstants.VertexFormat.Uint32x3 */;\n case 4:\n return \"uint32x4\" /* WebGPUConstants.VertexFormat.Uint32x4 */;\n }\n break;\n case VertexBuffer.FLOAT:\n switch (size) {\n case 1:\n return \"float32\" /* WebGPUConstants.VertexFormat.Float32 */;\n case 2:\n return \"float32x2\" /* WebGPUConstants.VertexFormat.Float32x2 */;\n case 3:\n return \"float32x3\" /* WebGPUConstants.VertexFormat.Float32x3 */;\n case 4:\n return \"float32x4\" /* WebGPUConstants.VertexFormat.Float32x4 */;\n }\n break;\n }\n throw new Error(`Invalid Format '${vertexBuffer.getKind()}' - type=${type}, normalized=${normalized}, size=${size}`);\n }\n _getAphaBlendState() {\n if (!this._alphaBlendEnabled) {\n return null;\n }\n return {\n srcFactor: WebGPUCacheRenderPipeline._GetAphaBlendFactor(this._alphaBlendFuncParams[2]),\n dstFactor: WebGPUCacheRenderPipeline._GetAphaBlendFactor(this._alphaBlendFuncParams[3]),\n operation: WebGPUCacheRenderPipeline._GetAphaBlendOperation(this._alphaBlendEqParams[1]),\n };\n }\n _getColorBlendState() {\n if (!this._alphaBlendEnabled) {\n return null;\n }\n return {\n srcFactor: WebGPUCacheRenderPipeline._GetAphaBlendFactor(this._alphaBlendFuncParams[0]),\n dstFactor: WebGPUCacheRenderPipeline._GetAphaBlendFactor(this._alphaBlendFuncParams[1]),\n operation: WebGPUCacheRenderPipeline._GetAphaBlendOperation(this._alphaBlendEqParams[0]),\n };\n }\n _setShaderStage(id) {\n if (this._shaderId !== id) {\n this._shaderId = id;\n this._states[StatePosition.ShaderStage] = id;\n this._isDirty = true;\n this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.ShaderStage);\n }\n }\n _setRasterizationState(topology, sampleCount) {\n const frontFace = this._frontFace;\n const cullMode = this._cullEnabled ? this._cullFace : 0;\n const clampDepth = this._clampDepth ? 1 : 0;\n const alphaToCoverage = this._alphaToCoverageEnabled ? 1 : 0;\n const rasterizationState = frontFace - 1 + (cullMode << 1) + (clampDepth << 3) + (alphaToCoverage << 4) + (topology << 5) + (sampleCount << 8);\n if (this._rasterizationState !== rasterizationState) {\n this._rasterizationState = rasterizationState;\n this._states[StatePosition.RasterizationState] = this._rasterizationState;\n this._isDirty = true;\n this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.RasterizationState);\n }\n }\n _setColorStates() {\n let colorStates = ((this._writeMask ? 1 : 0) << 22) + (this._colorFormat << 23) + ((this._depthWriteEnabled ? 1 : 0) << 29); // this state has been moved from depthStencilState here because alpha and depth are related (generally when alpha is on, depth write is off and the other way around)\n if (this._alphaBlendEnabled) {\n colorStates +=\n ((this._alphaBlendFuncParams[0] === null ? 2 : alphaBlendFactorToIndex[this._alphaBlendFuncParams[0]]) << 0) +\n ((this._alphaBlendFuncParams[1] === null ? 2 : alphaBlendFactorToIndex[this._alphaBlendFuncParams[1]]) << 4) +\n ((this._alphaBlendFuncParams[2] === null ? 2 : alphaBlendFactorToIndex[this._alphaBlendFuncParams[2]]) << 8) +\n ((this._alphaBlendFuncParams[3] === null ? 2 : alphaBlendFactorToIndex[this._alphaBlendFuncParams[3]]) << 12) +\n ((this._alphaBlendEqParams[0] === null ? 1 : this._alphaBlendEqParams[0] - 0x8005) << 16) +\n ((this._alphaBlendEqParams[1] === null ? 1 : this._alphaBlendEqParams[1] - 0x8005) << 19);\n }\n if (colorStates !== this._colorStates) {\n this._colorStates = colorStates;\n this._states[StatePosition.ColorStates] = this._colorStates;\n this._isDirty = true;\n this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.ColorStates);\n }\n }\n _setDepthStencilState() {\n const stencilState = !this._stencilEnabled\n ? 7 /* ALWAYS */ + (1 /* KEEP */ << 3) + (1 /* KEEP */ << 6) + (1 /* KEEP */ << 9)\n : this._stencilFrontCompare + (this._stencilFrontDepthFailOp << 3) + (this._stencilFrontPassOp << 6) + (this._stencilFrontFailOp << 9);\n const depthStencilState = this._depthStencilFormat + ((this._depthTestEnabled ? this._depthCompare : 7) /* ALWAYS */ << 6) + (stencilState << 10); // stencil front - stencil back is the same\n if (this._depthStencilState !== depthStencilState) {\n this._depthStencilState = depthStencilState;\n this._states[StatePosition.DepthStencilState] = this._depthStencilState;\n this._isDirty = true;\n this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.DepthStencilState);\n }\n }\n _setVertexState(effect) {\n const currStateLen = this._statesLength;\n let newNumStates = StatePosition.VertexState;\n const webgpuPipelineContext = effect._pipelineContext;\n const attributes = webgpuPipelineContext.shaderProcessingContext.attributeNamesFromEffect;\n const locations = webgpuPipelineContext.shaderProcessingContext.attributeLocationsFromEffect;\n let currentGPUBuffer;\n let numVertexBuffers = 0;\n for (let index = 0; index < attributes.length; index++) {\n const location = locations[index];\n let vertexBuffer = (this._overrideVertexBuffers && this._overrideVertexBuffers[attributes[index]]) ?? this._vertexBuffers[attributes[index]];\n if (!vertexBuffer) {\n // In WebGL it's valid to not bind a vertex buffer to an attribute, but it's not valid in WebGPU\n // So we must bind a dummy buffer when we are not given one for a specific attribute\n vertexBuffer = this._emptyVertexBuffer;\n }\n const buffer = vertexBuffer.effectiveBuffer?.underlyingResource;\n // We optimize usage of GPUVertexBufferLayout: we will create a single GPUVertexBufferLayout for all the attributes which follow each other and which use the same GPU buffer\n // However, there are some constraints in the attribute.offset value range, so we must check for them before being able to reuse the same GPUVertexBufferLayout\n // See _getVertexInputDescriptor() below\n if (vertexBuffer._validOffsetRange === undefined) {\n const offset = vertexBuffer.effectiveByteOffset;\n const formatSize = vertexBuffer.getSize(true);\n const byteStride = vertexBuffer.effectiveByteStride;\n vertexBuffer._validOffsetRange =\n (offset + formatSize <= this._kMaxVertexBufferStride && byteStride === 0) || (byteStride !== 0 && offset + formatSize <= byteStride);\n }\n if (!(currentGPUBuffer && currentGPUBuffer === buffer && vertexBuffer._validOffsetRange)) {\n // we can't combine the previous vertexBuffer with the current one\n this.vertexBuffers[numVertexBuffers++] = vertexBuffer;\n currentGPUBuffer = vertexBuffer._validOffsetRange ? buffer : null;\n }\n const vid = vertexBuffer.hashCode + (location << 7);\n this._isDirty = this._isDirty || this._states[newNumStates] !== vid;\n this._states[newNumStates++] = vid;\n }\n this.vertexBuffers.length = numVertexBuffers;\n this._statesLength = newNumStates;\n this._isDirty = this._isDirty || newNumStates !== currStateLen;\n if (this._isDirty) {\n this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.VertexState);\n }\n }\n _setTextureState(textureState) {\n if (this._textureState !== textureState) {\n this._textureState = textureState;\n this._states[StatePosition.TextureStage] = this._textureState;\n this._isDirty = true;\n this._stateDirtyLowestIndex = Math.min(this._stateDirtyLowestIndex, StatePosition.TextureStage);\n }\n }\n _createPipelineLayout(webgpuPipelineContext) {\n if (this._useTextureStage) {\n return this._createPipelineLayoutWithTextureStage(webgpuPipelineContext);\n }\n const bindGroupLayouts = [];\n const bindGroupLayoutEntries = webgpuPipelineContext.shaderProcessingContext.bindGroupLayoutEntries;\n for (let i = 0; i < bindGroupLayoutEntries.length; i++) {\n const setDefinition = bindGroupLayoutEntries[i];\n bindGroupLayouts[i] = this._device.createBindGroupLayout({\n entries: setDefinition,\n });\n }\n webgpuPipelineContext.bindGroupLayouts[0] = bindGroupLayouts;\n return this._device.createPipelineLayout({ bindGroupLayouts });\n }\n _createPipelineLayoutWithTextureStage(webgpuPipelineContext) {\n const shaderProcessingContext = webgpuPipelineContext.shaderProcessingContext;\n const bindGroupLayoutEntries = shaderProcessingContext.bindGroupLayoutEntries;\n let bitVal = 1;\n for (let i = 0; i < bindGroupLayoutEntries.length; i++) {\n const setDefinition = bindGroupLayoutEntries[i];\n for (let j = 0; j < setDefinition.length; j++) {\n const entry = bindGroupLayoutEntries[i][j];\n if (entry.texture) {\n const name = shaderProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding].name;\n const textureInfo = shaderProcessingContext.availableTextures[name];\n const samplerInfo = textureInfo.autoBindSampler ? shaderProcessingContext.availableSamplers[name + Constants.AUTOSAMPLERSUFFIX] : null;\n let sampleType = textureInfo.sampleType;\n let samplerType = samplerInfo?.type ?? \"filtering\" /* WebGPUConstants.SamplerBindingType.Filtering */;\n if (this._textureState & bitVal && sampleType !== \"depth\" /* WebGPUConstants.TextureSampleType.Depth */) {\n // The texture is a 32 bits float texture but the system does not support linear filtering for them OR the texture is a depth texture with \"float\" filtering:\n // we set the sampler to \"non-filtering\" and the texture sample type to \"unfilterable-float\"\n if (textureInfo.autoBindSampler) {\n samplerType = \"non-filtering\" /* WebGPUConstants.SamplerBindingType.NonFiltering */;\n }\n sampleType = \"unfilterable-float\" /* WebGPUConstants.TextureSampleType.UnfilterableFloat */;\n }\n entry.texture.sampleType = sampleType;\n if (samplerInfo) {\n const binding = shaderProcessingContext.bindGroupLayoutEntryInfo[samplerInfo.binding.groupIndex][samplerInfo.binding.bindingIndex].index;\n bindGroupLayoutEntries[samplerInfo.binding.groupIndex][binding].sampler.type = samplerType;\n }\n bitVal = bitVal << 1;\n }\n }\n }\n const bindGroupLayouts = [];\n for (let i = 0; i < bindGroupLayoutEntries.length; ++i) {\n bindGroupLayouts[i] = this._device.createBindGroupLayout({\n entries: bindGroupLayoutEntries[i],\n });\n }\n webgpuPipelineContext.bindGroupLayouts[this._textureState] = bindGroupLayouts;\n return this._device.createPipelineLayout({ bindGroupLayouts });\n }\n _getVertexInputDescriptor(effect) {\n const descriptors = [];\n const webgpuPipelineContext = effect._pipelineContext;\n const attributes = webgpuPipelineContext.shaderProcessingContext.attributeNamesFromEffect;\n const locations = webgpuPipelineContext.shaderProcessingContext.attributeLocationsFromEffect;\n let currentGPUBuffer;\n let currentGPUAttributes;\n for (let index = 0; index < attributes.length; index++) {\n const location = locations[index];\n let vertexBuffer = (this._overrideVertexBuffers && this._overrideVertexBuffers[attributes[index]]) ?? this._vertexBuffers[attributes[index]];\n if (!vertexBuffer) {\n // In WebGL it's valid to not bind a vertex buffer to an attribute, but it's not valid in WebGPU\n // So we must bind a dummy buffer when we are not given one for a specific attribute\n vertexBuffer = this._emptyVertexBuffer;\n }\n let buffer = vertexBuffer.effectiveBuffer?.underlyingResource;\n // We reuse the same GPUVertexBufferLayout for all attributes that use the same underlying GPU buffer (and for attributes that follow each other in the attributes array)\n let offset = vertexBuffer.effectiveByteOffset;\n const invalidOffsetRange = !vertexBuffer._validOffsetRange;\n if (!(currentGPUBuffer && currentGPUAttributes && currentGPUBuffer === buffer) || invalidOffsetRange) {\n const vertexBufferDescriptor = {\n arrayStride: vertexBuffer.effectiveByteStride,\n stepMode: vertexBuffer.getIsInstanced() ? \"instance\" /* WebGPUConstants.VertexStepMode.Instance */ : \"vertex\" /* WebGPUConstants.VertexStepMode.Vertex */,\n attributes: [],\n };\n descriptors.push(vertexBufferDescriptor);\n currentGPUAttributes = vertexBufferDescriptor.attributes;\n if (invalidOffsetRange) {\n offset = 0; // the offset will be set directly in the setVertexBuffer call\n buffer = null; // buffer can't be reused\n }\n }\n currentGPUAttributes.push({\n shaderLocation: location,\n offset,\n format: WebGPUCacheRenderPipeline._GetVertexInputDescriptorFormat(vertexBuffer),\n });\n currentGPUBuffer = buffer;\n }\n return descriptors;\n }\n _createRenderPipeline(effect, topology, sampleCount) {\n const webgpuPipelineContext = effect._pipelineContext;\n const inputStateDescriptor = this._getVertexInputDescriptor(effect);\n const pipelineLayout = this._createPipelineLayout(webgpuPipelineContext);\n const colorStates = [];\n const alphaBlend = this._getAphaBlendState();\n const colorBlend = this._getColorBlendState();\n if (this._vertexBuffers) {\n checkNonFloatVertexBuffers(this._vertexBuffers, effect);\n }\n if (this._mrtAttachments1 > 0) {\n for (let i = 0; i < this._mrtFormats.length; ++i) {\n const format = this._mrtFormats[i];\n if (format) {\n const descr = {\n format,\n writeMask: (this._mrtEnabledMask & (1 << i)) !== 0 ? this._writeMask : 0,\n };\n if (alphaBlend && colorBlend) {\n descr.blend = {\n alpha: alphaBlend,\n color: colorBlend,\n };\n }\n colorStates.push(descr);\n }\n else {\n colorStates.push(null);\n }\n }\n }\n else {\n if (this._webgpuColorFormat[0]) {\n const descr = {\n format: this._webgpuColorFormat[0],\n writeMask: this._writeMask,\n };\n if (alphaBlend && colorBlend) {\n descr.blend = {\n alpha: alphaBlend,\n color: colorBlend,\n };\n }\n colorStates.push(descr);\n }\n else {\n colorStates.push(null);\n }\n }\n const stencilFrontBack = {\n compare: WebGPUCacheRenderPipeline._GetCompareFunction(this._stencilEnabled ? this._stencilFrontCompare : 7 /* ALWAYS */),\n depthFailOp: WebGPUCacheRenderPipeline._GetStencilOpFunction(this._stencilEnabled ? this._stencilFrontDepthFailOp : 1 /* KEEP */),\n failOp: WebGPUCacheRenderPipeline._GetStencilOpFunction(this._stencilEnabled ? this._stencilFrontFailOp : 1 /* KEEP */),\n passOp: WebGPUCacheRenderPipeline._GetStencilOpFunction(this._stencilEnabled ? this._stencilFrontPassOp : 1 /* KEEP */),\n };\n const topologyIsTriangle = topology === \"triangle-list\" /* WebGPUConstants.PrimitiveTopology.TriangleList */ || topology === \"triangle-strip\" /* WebGPUConstants.PrimitiveTopology.TriangleStrip */;\n let stripIndexFormat = undefined;\n if (topology === \"line-strip\" /* WebGPUConstants.PrimitiveTopology.LineStrip */ || topology === \"triangle-strip\" /* WebGPUConstants.PrimitiveTopology.TriangleStrip */) {\n stripIndexFormat = !this._indexBuffer || this._indexBuffer.is32Bits ? \"uint32\" /* WebGPUConstants.IndexFormat.Uint32 */ : \"uint16\" /* WebGPUConstants.IndexFormat.Uint16 */;\n }\n const depthStencilFormatHasStencil = this._webgpuDepthStencilFormat ? WebGPUTextureHelper.HasStencilAspect(this._webgpuDepthStencilFormat) : false;\n return this._device.createRenderPipeline({\n label: `RenderPipeline_${colorStates[0]?.format ?? \"nooutput\"}_${this._webgpuDepthStencilFormat ?? \"nodepth\"}_samples${sampleCount}_textureState${this._textureState}`,\n layout: pipelineLayout,\n vertex: {\n module: webgpuPipelineContext.stages.vertexStage.module,\n entryPoint: webgpuPipelineContext.stages.vertexStage.entryPoint,\n buffers: inputStateDescriptor,\n },\n primitive: {\n topology,\n stripIndexFormat,\n frontFace: this._frontFace === 1 ? \"ccw\" /* WebGPUConstants.FrontFace.CCW */ : \"cw\" /* WebGPUConstants.FrontFace.CW */,\n cullMode: !this._cullEnabled ? \"none\" /* WebGPUConstants.CullMode.None */ : this._cullFace === 2 ? \"front\" /* WebGPUConstants.CullMode.Front */ : \"back\" /* WebGPUConstants.CullMode.Back */,\n },\n fragment: !webgpuPipelineContext.stages.fragmentStage\n ? undefined\n : {\n module: webgpuPipelineContext.stages.fragmentStage.module,\n entryPoint: webgpuPipelineContext.stages.fragmentStage.entryPoint,\n targets: colorStates,\n },\n multisample: {\n count: sampleCount,\n /*mask,\n alphaToCoverageEnabled,*/\n },\n depthStencil: this._webgpuDepthStencilFormat === undefined\n ? undefined\n : {\n depthWriteEnabled: this._depthWriteEnabled,\n depthCompare: this._depthTestEnabled ? WebGPUCacheRenderPipeline._GetCompareFunction(this._depthCompare) : \"always\" /* WebGPUConstants.CompareFunction.Always */,\n format: this._webgpuDepthStencilFormat,\n stencilFront: this._stencilEnabled && depthStencilFormatHasStencil ? stencilFrontBack : undefined,\n stencilBack: this._stencilEnabled && depthStencilFormatHasStencil ? stencilFrontBack : undefined,\n stencilReadMask: this._stencilEnabled && depthStencilFormatHasStencil ? this._stencilReadMask : undefined,\n stencilWriteMask: this._stencilEnabled && depthStencilFormatHasStencil ? this._stencilWriteMask : undefined,\n depthBias: this._depthBias,\n depthBiasClamp: topologyIsTriangle ? this._depthBiasClamp : 0,\n depthBiasSlopeScale: topologyIsTriangle ? this._depthBiasSlopeScale : 0,\n },\n });\n }\n}\nWebGPUCacheRenderPipeline.NumCacheHitWithoutHash = 0;\nWebGPUCacheRenderPipeline.NumCacheHitWithHash = 0;\nWebGPUCacheRenderPipeline.NumCacheMiss = 0;\nWebGPUCacheRenderPipeline.NumPipelineCreationLastFrame = 0;\nWebGPUCacheRenderPipeline._NumPipelineCreationCurrentFrame = 0;\n//# sourceMappingURL=webgpuCacheRenderPipeline.js.map","import { WebGPUCacheRenderPipeline } from \"./webgpuCacheRenderPipeline\";\n/** @internal */\nclass NodeState {\n constructor() {\n this.values = {};\n }\n count() {\n let countNode = 0, countPipeline = this.pipeline ? 1 : 0;\n for (const value in this.values) {\n const node = this.values[value];\n const [childCountNodes, childCoundPipeline] = node.count();\n countNode += childCountNodes;\n countPipeline += childCoundPipeline;\n countNode++;\n }\n return [countNode, countPipeline];\n }\n}\n/** @internal */\nexport class WebGPUCacheRenderPipelineTree extends WebGPUCacheRenderPipeline {\n static GetNodeCounts() {\n const counts = WebGPUCacheRenderPipelineTree._Cache.count();\n return { nodeCount: counts[0], pipelineCount: counts[1] };\n }\n static _GetPipelines(node, pipelines, curPath, curPathLen) {\n if (node.pipeline) {\n const path = curPath.slice();\n path.length = curPathLen;\n pipelines.push(path);\n }\n for (const value in node.values) {\n const nnode = node.values[value];\n curPath[curPathLen] = parseInt(value);\n WebGPUCacheRenderPipelineTree._GetPipelines(nnode, pipelines, curPath, curPathLen + 1);\n }\n }\n static GetPipelines() {\n const pipelines = [];\n WebGPUCacheRenderPipelineTree._GetPipelines(WebGPUCacheRenderPipelineTree._Cache, pipelines, [], 0);\n return pipelines;\n }\n static ResetCache() {\n WebGPUCacheRenderPipelineTree._Cache = new NodeState();\n }\n reset() {\n this._nodeStack = [];\n this._nodeStack[0] = WebGPUCacheRenderPipelineTree._Cache;\n super.reset();\n }\n _getRenderPipeline(param) {\n let node = this._nodeStack[this._stateDirtyLowestIndex];\n for (let i = this._stateDirtyLowestIndex; i < this._statesLength; ++i) {\n let nn = node.values[this._states[i]];\n if (!nn) {\n nn = new NodeState();\n node.values[this._states[i]] = nn;\n }\n node = nn;\n this._nodeStack[i + 1] = node;\n }\n param.token = node;\n param.pipeline = node.pipeline;\n }\n _setRenderPipeline(param) {\n param.token.pipeline = param.pipeline;\n }\n}\nWebGPUCacheRenderPipelineTree._Cache = new NodeState();\n//# sourceMappingURL=webgpuCacheRenderPipelineTree.js.map","import { StencilStateComposer } from \"../../States/stencilStateComposer\";\n/**\n * @internal\n **/\nexport class WebGPUStencilStateComposer extends StencilStateComposer {\n constructor(cache) {\n super(false);\n this._cache = cache;\n this.reset();\n }\n get func() {\n return this._func;\n }\n set func(value) {\n if (this._func === value) {\n return;\n }\n this._func = value;\n this._cache.setStencilCompare(value);\n }\n get funcMask() {\n return this._funcMask;\n }\n set funcMask(value) {\n if (this._funcMask === value) {\n return;\n }\n this._funcMask = value;\n this._cache.setStencilReadMask(value);\n }\n get opStencilFail() {\n return this._opStencilFail;\n }\n set opStencilFail(value) {\n if (this._opStencilFail === value) {\n return;\n }\n this._opStencilFail = value;\n this._cache.setStencilFailOp(value);\n }\n get opDepthFail() {\n return this._opDepthFail;\n }\n set opDepthFail(value) {\n if (this._opDepthFail === value) {\n return;\n }\n this._opDepthFail = value;\n this._cache.setStencilDepthFailOp(value);\n }\n get opStencilDepthPass() {\n return this._opStencilDepthPass;\n }\n set opStencilDepthPass(value) {\n if (this._opStencilDepthPass === value) {\n return;\n }\n this._opStencilDepthPass = value;\n this._cache.setStencilPassOp(value);\n }\n get mask() {\n return this._mask;\n }\n set mask(value) {\n if (this._mask === value) {\n return;\n }\n this._mask = value;\n this._cache.setStencilWriteMask(value);\n }\n get enabled() {\n return this._enabled;\n }\n set enabled(value) {\n if (this._enabled === value) {\n return;\n }\n this._enabled = value;\n this._cache.setStencilEnabled(value);\n }\n reset() {\n super.reset();\n this._cache.resetStencilState();\n }\n apply() {\n const stencilMaterialEnabled = this.stencilMaterial?.enabled;\n this.enabled = stencilMaterialEnabled ? this.stencilMaterial.enabled : this.stencilGlobal.enabled;\n if (!this.enabled) {\n return;\n }\n this.func = stencilMaterialEnabled ? this.stencilMaterial.func : this.stencilGlobal.func;\n this.funcRef = stencilMaterialEnabled ? this.stencilMaterial.funcRef : this.stencilGlobal.funcRef;\n this.funcMask = stencilMaterialEnabled ? this.stencilMaterial.funcMask : this.stencilGlobal.funcMask;\n this.opStencilFail = stencilMaterialEnabled ? this.stencilMaterial.opStencilFail : this.stencilGlobal.opStencilFail;\n this.opDepthFail = stencilMaterialEnabled ? this.stencilMaterial.opDepthFail : this.stencilGlobal.opDepthFail;\n this.opStencilDepthPass = stencilMaterialEnabled ? this.stencilMaterial.opStencilDepthPass : this.stencilGlobal.opStencilDepthPass;\n this.mask = stencilMaterialEnabled ? this.stencilMaterial.mask : this.stencilGlobal.mask;\n }\n}\n//# sourceMappingURL=webgpuStencilStateComposer.js.map","import { DepthCullingState } from \"../../States/depthCullingState\";\n/**\n * @internal\n **/\nexport class WebGPUDepthCullingState extends DepthCullingState {\n /**\n * Initializes the state.\n * @param cache\n */\n constructor(cache) {\n super(false);\n this._cache = cache;\n this.reset();\n }\n get zOffset() {\n return this._zOffset;\n }\n set zOffset(value) {\n if (this._zOffset === value) {\n return;\n }\n this._zOffset = value;\n this._isZOffsetDirty = true;\n this._cache.setDepthBiasSlopeScale(value);\n }\n get zOffsetUnits() {\n return this._zOffsetUnits;\n }\n set zOffsetUnits(value) {\n if (this._zOffsetUnits === value) {\n return;\n }\n this._zOffsetUnits = value;\n this._isZOffsetDirty = true;\n this._cache.setDepthBias(value);\n }\n get cullFace() {\n return this._cullFace;\n }\n set cullFace(value) {\n if (this._cullFace === value) {\n return;\n }\n this._cullFace = value;\n this._isCullFaceDirty = true;\n this._cache.setCullFace(value ?? 1);\n }\n get cull() {\n return this._cull;\n }\n set cull(value) {\n if (this._cull === value) {\n return;\n }\n this._cull = value;\n this._isCullDirty = true;\n this._cache.setCullEnabled(!!value);\n }\n get depthFunc() {\n return this._depthFunc;\n }\n set depthFunc(value) {\n if (this._depthFunc === value) {\n return;\n }\n this._depthFunc = value;\n this._isDepthFuncDirty = true;\n this._cache.setDepthCompare(value);\n }\n get depthMask() {\n return this._depthMask;\n }\n set depthMask(value) {\n if (this._depthMask === value) {\n return;\n }\n this._depthMask = value;\n this._isDepthMaskDirty = true;\n this._cache.setDepthWriteEnabled(value);\n }\n get depthTest() {\n return this._depthTest;\n }\n set depthTest(value) {\n if (this._depthTest === value) {\n return;\n }\n this._depthTest = value;\n this._isDepthTestDirty = true;\n this._cache.setDepthTestEnabled(value);\n }\n get frontFace() {\n return this._frontFace;\n }\n set frontFace(value) {\n if (this._frontFace === value) {\n return;\n }\n this._frontFace = value;\n this._isFrontFaceDirty = true;\n this._cache.setFrontFace(value ?? 2);\n }\n reset() {\n super.reset();\n this._cache.resetDepthCullingState();\n }\n apply() {\n // nothing to do\n }\n}\n//# sourceMappingURL=webgpuDepthCullingState.js.map","import { Constants } from \"../../Engines/constants\";\nimport { InternalTexture } from \"./internalTexture\";\n/**\n * Class used to store an external texture (like GPUExternalTexture in WebGPU)\n */\nexport class ExternalTexture {\n /**\n * Checks if a texture is an external or internal texture\n * @param texture the external or internal texture\n * @returns true if the texture is an external texture, else false\n */\n static IsExternalTexture(texture) {\n return texture.underlyingResource !== undefined;\n }\n /**\n * Get the class name of the texture.\n * @returns \"ExternalTexture\"\n */\n getClassName() {\n return \"ExternalTexture\";\n }\n /**\n * Gets the underlying texture object\n */\n get underlyingResource() {\n return this._video;\n }\n /**\n * Constructs the texture\n * @param video The video the texture should be wrapped around\n */\n constructor(video) {\n /**\n * Gets a boolean indicating if the texture uses mipmaps\n */\n this.useMipMaps = false;\n /**\n * The type of the underlying texture is implementation dependent, so return \"UNDEFINED\" for the type\n */\n this.type = Constants.TEXTURETYPE_UNDEFINED;\n /**\n * The format of the underlying texture is implementation dependent, so return \"UNDEFINED\" for the format\n */\n this.format = Constants.TEXTUREFORMAT_UNDEFINED;\n this._video = video;\n this.uniqueId = InternalTexture._Counter++;\n }\n /**\n * Get if the texture is ready to be used (downloaded, converted, mip mapped...).\n * @returns true if fully ready\n */\n isReady() {\n return this._video.readyState >= this._video.HAVE_CURRENT_DATA;\n }\n /**\n * Dispose the texture and release its associated resources.\n */\n dispose() { }\n}\n//# sourceMappingURL=externalTexture.js.map","/* eslint-disable babylonjs/available */\n/* eslint-disable jsdoc/require-jsdoc */\nimport { ExternalTexture } from \"../../Materials/Textures/externalTexture\";\nimport { Constants } from \"../constants\";\nimport { WebGPUCacheSampler } from \"./webgpuCacheSampler\";\n/** @internal */\nexport class WebGPUMaterialContext {\n get forceBindGroupCreation() {\n // If there is at least one external texture to bind, we must recreate the bind groups each time\n // because we need to retrieve a new texture each frame (by calling device.importExternalTexture)\n return this._numExternalTextures > 0;\n }\n get hasFloatOrDepthTextures() {\n return this._numFloatOrDepthTextures > 0;\n }\n constructor() {\n this.uniqueId = WebGPUMaterialContext._Counter++;\n this.updateId = 0;\n this.textureState = 0;\n this.reset();\n }\n reset() {\n this.samplers = {};\n this.textures = {};\n this.isDirty = true;\n this._numFloatOrDepthTextures = 0;\n this._numExternalTextures = 0;\n }\n setSampler(name, sampler) {\n let samplerCache = this.samplers[name];\n let currentHashCode = -1;\n if (!samplerCache) {\n this.samplers[name] = samplerCache = { sampler, hashCode: 0 };\n }\n else {\n currentHashCode = samplerCache.hashCode;\n }\n samplerCache.sampler = sampler;\n samplerCache.hashCode = sampler ? WebGPUCacheSampler.GetSamplerHashCode(sampler) : 0;\n const isDirty = currentHashCode !== samplerCache.hashCode;\n if (isDirty) {\n this.updateId++;\n }\n this.isDirty ||= isDirty;\n }\n setTexture(name, texture) {\n let textureCache = this.textures[name];\n let currentTextureId = -1;\n if (!textureCache) {\n this.textures[name] = textureCache = { texture, isFloatOrDepthTexture: false, isExternalTexture: false };\n }\n else {\n currentTextureId = textureCache.texture?.uniqueId ?? -1;\n }\n if (textureCache.isExternalTexture) {\n this._numExternalTextures--;\n }\n if (textureCache.isFloatOrDepthTexture) {\n this._numFloatOrDepthTextures--;\n }\n if (texture) {\n textureCache.isFloatOrDepthTexture =\n texture.type === Constants.TEXTURETYPE_FLOAT ||\n (texture.format >= Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 && texture.format <= Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8);\n textureCache.isExternalTexture = ExternalTexture.IsExternalTexture(texture);\n if (textureCache.isFloatOrDepthTexture) {\n this._numFloatOrDepthTextures++;\n }\n if (textureCache.isExternalTexture) {\n this._numExternalTextures++;\n }\n }\n else {\n textureCache.isFloatOrDepthTexture = false;\n textureCache.isExternalTexture = false;\n }\n textureCache.texture = texture;\n const isDirty = currentTextureId !== (texture?.uniqueId ?? -1);\n if (isDirty) {\n this.updateId++;\n }\n this.isDirty ||= isDirty;\n }\n}\nWebGPUMaterialContext._Counter = 0;\n//# sourceMappingURL=webgpuMaterialContext.js.map","import * as WebGPUConstants from \"./webgpuConstants\";\n/** @internal */\nexport class WebGPUDrawContext {\n isDirty(materialContextUpdateId) {\n return this._isDirty || this._materialContextUpdateId !== materialContextUpdateId;\n }\n resetIsDirty(materialContextUpdateId) {\n this._isDirty = false;\n this._materialContextUpdateId = materialContextUpdateId;\n }\n get useInstancing() {\n return this._useInstancing;\n }\n set useInstancing(use) {\n if (this._useInstancing === use) {\n return;\n }\n if (!use) {\n if (this.indirectDrawBuffer) {\n this._bufferManager.releaseBuffer(this.indirectDrawBuffer);\n }\n this.indirectDrawBuffer = undefined;\n this._indirectDrawData = undefined;\n }\n else {\n this.indirectDrawBuffer = this._bufferManager.createRawBuffer(20, WebGPUConstants.BufferUsage.CopyDst | WebGPUConstants.BufferUsage.Indirect | WebGPUConstants.BufferUsage.Storage, undefined, \"IndirectDrawBuffer\");\n this._indirectDrawData = new Uint32Array(5);\n this._indirectDrawData[3] = 0;\n this._indirectDrawData[4] = 0;\n }\n this._useInstancing = use;\n this._currentInstanceCount = -1;\n }\n constructor(bufferManager) {\n this._bufferManager = bufferManager;\n this.uniqueId = WebGPUDrawContext._Counter++;\n this._useInstancing = false;\n this._currentInstanceCount = 0;\n this.reset();\n }\n reset() {\n this.buffers = {};\n this._isDirty = true;\n this._materialContextUpdateId = 0;\n this.fastBundle = undefined;\n this.bindGroups = undefined;\n }\n setBuffer(name, buffer) {\n this._isDirty ||= buffer?.uniqueId !== this.buffers[name]?.uniqueId;\n this.buffers[name] = buffer;\n }\n setIndirectData(indexOrVertexCount, instanceCount, firstIndexOrVertex) {\n if (instanceCount === this._currentInstanceCount || !this.indirectDrawBuffer || !this._indirectDrawData) {\n // The current buffer is already up to date so do nothing\n // Note that we only check for instanceCount and not indexOrVertexCount nor firstIndexOrVertex because those values\n // are supposed to not change during the lifetime of a draw context\n return;\n }\n this._currentInstanceCount = instanceCount;\n this._indirectDrawData[0] = indexOrVertexCount;\n this._indirectDrawData[1] = instanceCount;\n this._indirectDrawData[2] = firstIndexOrVertex;\n this._bufferManager.setRawData(this.indirectDrawBuffer, 0, this._indirectDrawData, 0, 20);\n }\n dispose() {\n if (this.indirectDrawBuffer) {\n this._bufferManager.releaseBuffer(this.indirectDrawBuffer);\n this.indirectDrawBuffer = undefined;\n this._indirectDrawData = undefined;\n }\n this.fastBundle = undefined;\n this.bindGroups = undefined;\n this.buffers = undefined;\n }\n}\nWebGPUDrawContext._Counter = 0;\n//# sourceMappingURL=webgpuDrawContext.js.map","/* eslint-disable babylonjs/available */\n/* eslint-disable jsdoc/require-jsdoc */\nimport { Logger } from \"../../Misc/logger\";\n/**\n * Sampler hash codes are 19 bits long, so using a start value of 2^20 for buffer ids will ensure we can't have any collision with the sampler hash codes\n */\nconst bufferIdStart = 1 << 20;\n/**\n * textureIdStart is added to texture ids to ensure we can't have any collision with the buffer ids / sampler hash codes.\n * 2^35 for textureIdStart means we can have:\n * - 2^(35-20) = 2^15 = 32768 possible buffer ids\n * - 2^(53-35) = 2^18 = 524288 possible texture ids\n */\nconst textureIdStart = 2 ** 35;\nclass WebGPUBindGroupCacheNode {\n constructor() {\n this.values = {};\n }\n}\n/** @internal */\nexport class WebGPUCacheBindGroups {\n static get Statistics() {\n return {\n totalCreated: WebGPUCacheBindGroups.NumBindGroupsCreatedTotal,\n lastFrameCreated: WebGPUCacheBindGroups.NumBindGroupsCreatedLastFrame,\n lookupLastFrame: WebGPUCacheBindGroups.NumBindGroupsLookupLastFrame,\n noLookupLastFrame: WebGPUCacheBindGroups.NumBindGroupsNoLookupLastFrame,\n };\n }\n static ResetCache() {\n WebGPUCacheBindGroups._Cache = new WebGPUBindGroupCacheNode();\n WebGPUCacheBindGroups.NumBindGroupsCreatedTotal = 0;\n WebGPUCacheBindGroups.NumBindGroupsCreatedLastFrame = 0;\n WebGPUCacheBindGroups.NumBindGroupsLookupLastFrame = 0;\n WebGPUCacheBindGroups.NumBindGroupsNoLookupLastFrame = 0;\n WebGPUCacheBindGroups._NumBindGroupsCreatedCurrentFrame = 0;\n WebGPUCacheBindGroups._NumBindGroupsLookupCurrentFrame = 0;\n WebGPUCacheBindGroups._NumBindGroupsNoLookupCurrentFrame = 0;\n }\n constructor(device, cacheSampler, engine) {\n this.disabled = false;\n this._device = device;\n this._cacheSampler = cacheSampler;\n this._engine = engine;\n }\n endFrame() {\n WebGPUCacheBindGroups.NumBindGroupsCreatedLastFrame = WebGPUCacheBindGroups._NumBindGroupsCreatedCurrentFrame;\n WebGPUCacheBindGroups.NumBindGroupsLookupLastFrame = WebGPUCacheBindGroups._NumBindGroupsLookupCurrentFrame;\n WebGPUCacheBindGroups.NumBindGroupsNoLookupLastFrame = WebGPUCacheBindGroups._NumBindGroupsNoLookupCurrentFrame;\n WebGPUCacheBindGroups._NumBindGroupsCreatedCurrentFrame = 0;\n WebGPUCacheBindGroups._NumBindGroupsLookupCurrentFrame = 0;\n WebGPUCacheBindGroups._NumBindGroupsNoLookupCurrentFrame = 0;\n }\n /**\n * Cache is currently based on the uniform/storage buffers, samplers and textures used by the binding groups.\n * Note that all uniform buffers have an offset of 0 in Babylon and we don't have a use case where we would have the same buffer used with different capacity values:\n * that means we don't need to factor in the offset/size of the buffer in the cache, only the id\n * @param webgpuPipelineContext\n * @param drawContext\n * @param materialContext\n * @returns a bind group array\n */\n getBindGroups(webgpuPipelineContext, drawContext, materialContext) {\n let bindGroups = undefined;\n let node = WebGPUCacheBindGroups._Cache;\n const cacheIsDisabled = this.disabled || materialContext.forceBindGroupCreation;\n if (!cacheIsDisabled) {\n if (!drawContext.isDirty(materialContext.updateId) && !materialContext.isDirty) {\n WebGPUCacheBindGroups._NumBindGroupsNoLookupCurrentFrame++;\n return drawContext.bindGroups;\n }\n for (const bufferName of webgpuPipelineContext.shaderProcessingContext.bufferNames) {\n const uboId = (drawContext.buffers[bufferName]?.uniqueId ?? 0) + bufferIdStart;\n let nextNode = node.values[uboId];\n if (!nextNode) {\n nextNode = new WebGPUBindGroupCacheNode();\n node.values[uboId] = nextNode;\n }\n node = nextNode;\n }\n for (const samplerName of webgpuPipelineContext.shaderProcessingContext.samplerNames) {\n const samplerHashCode = materialContext.samplers[samplerName]?.hashCode ?? 0;\n let nextNode = node.values[samplerHashCode];\n if (!nextNode) {\n nextNode = new WebGPUBindGroupCacheNode();\n node.values[samplerHashCode] = nextNode;\n }\n node = nextNode;\n }\n for (const textureName of webgpuPipelineContext.shaderProcessingContext.textureNames) {\n const textureId = (materialContext.textures[textureName]?.texture?.uniqueId ?? 0) + textureIdStart;\n let nextNode = node.values[textureId];\n if (!nextNode) {\n nextNode = new WebGPUBindGroupCacheNode();\n node.values[textureId] = nextNode;\n }\n node = nextNode;\n }\n bindGroups = node.bindGroups;\n }\n drawContext.resetIsDirty(materialContext.updateId);\n materialContext.isDirty = false;\n if (bindGroups) {\n drawContext.bindGroups = bindGroups;\n WebGPUCacheBindGroups._NumBindGroupsLookupCurrentFrame++;\n return bindGroups;\n }\n bindGroups = [];\n drawContext.bindGroups = bindGroups;\n if (!cacheIsDisabled) {\n node.bindGroups = bindGroups;\n }\n WebGPUCacheBindGroups.NumBindGroupsCreatedTotal++;\n WebGPUCacheBindGroups._NumBindGroupsCreatedCurrentFrame++;\n const bindGroupLayouts = webgpuPipelineContext.bindGroupLayouts[materialContext.textureState];\n for (let i = 0; i < webgpuPipelineContext.shaderProcessingContext.bindGroupLayoutEntries.length; i++) {\n const setDefinition = webgpuPipelineContext.shaderProcessingContext.bindGroupLayoutEntries[i];\n const entries = webgpuPipelineContext.shaderProcessingContext.bindGroupEntries[i];\n for (let j = 0; j < setDefinition.length; j++) {\n const entry = webgpuPipelineContext.shaderProcessingContext.bindGroupLayoutEntries[i][j];\n const entryInfo = webgpuPipelineContext.shaderProcessingContext.bindGroupLayoutEntryInfo[i][entry.binding];\n const name = entryInfo.nameInArrayOfTexture ?? entryInfo.name;\n if (entry.sampler) {\n const bindingInfo = materialContext.samplers[name];\n if (bindingInfo) {\n const sampler = bindingInfo.sampler;\n if (!sampler) {\n if (this._engine.dbgSanityChecks) {\n Logger.Error(`Trying to bind a null sampler! entry=${JSON.stringify(entry)}, name=${name}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => (key === \"texture\" ? \"<no dump>\" : value))}, materialContext.uniqueId=${materialContext.uniqueId}`, 50);\n }\n continue;\n }\n entries[j].resource = this._cacheSampler.getSampler(sampler, false, bindingInfo.hashCode, sampler.label);\n }\n else {\n Logger.Error(`Sampler \"${name}\" could not be bound. entry=${JSON.stringify(entry)}, materialContext=${JSON.stringify(materialContext, (key, value) => key === \"texture\" || key === \"sampler\" ? \"<no dump>\" : value)}`, 50);\n }\n }\n else if (entry.texture || entry.storageTexture) {\n const bindingInfo = materialContext.textures[name];\n if (bindingInfo) {\n if (this._engine.dbgSanityChecks && bindingInfo.texture === null) {\n Logger.Error(`Trying to bind a null texture! entry=${JSON.stringify(entry)}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => key === \"texture\" ? \"<no dump>\" : value)}, materialContext.uniqueId=${materialContext.uniqueId}`, 50);\n continue;\n }\n const hardwareTexture = bindingInfo.texture._hardwareTexture;\n if (this._engine.dbgSanityChecks &&\n (!hardwareTexture || (entry.texture && !hardwareTexture.view) || (entry.storageTexture && !hardwareTexture.viewForWriting))) {\n Logger.Error(`Trying to bind a null gpu texture or view! entry=${JSON.stringify(entry)}, name=${name}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => (key === \"texture\" ? \"<no dump>\" : value))}, isReady=${bindingInfo.texture?.isReady}, materialContext.uniqueId=${materialContext.uniqueId}`, 50);\n continue;\n }\n entries[j].resource = entry.storageTexture ? hardwareTexture.viewForWriting : hardwareTexture.view;\n }\n else {\n Logger.Error(`Texture \"${name}\" could not be bound. entry=${JSON.stringify(entry)}, materialContext=${JSON.stringify(materialContext, (key, value) => key === \"texture\" || key === \"sampler\" ? \"<no dump>\" : value)}`, 50);\n }\n }\n else if (entry.externalTexture) {\n const bindingInfo = materialContext.textures[name];\n if (bindingInfo) {\n if (this._engine.dbgSanityChecks && bindingInfo.texture === null) {\n Logger.Error(`Trying to bind a null external texture! entry=${JSON.stringify(entry)}, name=${name}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => (key === \"texture\" ? \"<no dump>\" : value))}, materialContext.uniqueId=${materialContext.uniqueId}`, 50);\n continue;\n }\n const externalTexture = bindingInfo.texture.underlyingResource;\n if (this._engine.dbgSanityChecks && !externalTexture) {\n Logger.Error(`Trying to bind a null gpu external texture! entry=${JSON.stringify(entry)}, name=${name}, bindingInfo=${JSON.stringify(bindingInfo, (key, value) => (key === \"texture\" ? \"<no dump>\" : value))}, isReady=${bindingInfo.texture?.isReady}, materialContext.uniqueId=${materialContext.uniqueId}`, 50);\n continue;\n }\n entries[j].resource = this._device.importExternalTexture({ source: externalTexture });\n }\n else {\n Logger.Error(`Texture \"${name}\" could not be bound. entry=${JSON.stringify(entry)}, materialContext=${JSON.stringify(materialContext, (key, value) => key === \"texture\" || key === \"sampler\" ? \"<no dump>\" : value)}`, 50);\n }\n }\n else if (entry.buffer) {\n const dataBuffer = drawContext.buffers[name];\n if (dataBuffer) {\n const webgpuBuffer = dataBuffer.underlyingResource;\n entries[j].resource.buffer = webgpuBuffer;\n entries[j].resource.size = dataBuffer.capacity;\n }\n else {\n Logger.Error(`Can't find buffer \"${name}\". entry=${JSON.stringify(entry)}, buffers=${JSON.stringify(drawContext.buffers)}, drawContext.uniqueId=${drawContext.uniqueId}`, 50);\n }\n }\n }\n const groupLayout = bindGroupLayouts[i];\n bindGroups[i] = this._device.createBindGroup({\n layout: groupLayout,\n entries,\n });\n }\n return bindGroups;\n }\n}\nWebGPUCacheBindGroups.NumBindGroupsCreatedTotal = 0;\nWebGPUCacheBindGroups.NumBindGroupsCreatedLastFrame = 0;\nWebGPUCacheBindGroups.NumBindGroupsLookupLastFrame = 0;\nWebGPUCacheBindGroups.NumBindGroupsNoLookupLastFrame = 0;\nWebGPUCacheBindGroups._Cache = new WebGPUBindGroupCacheNode();\nWebGPUCacheBindGroups._NumBindGroupsCreatedCurrentFrame = 0;\nWebGPUCacheBindGroups._NumBindGroupsLookupCurrentFrame = 0;\nWebGPUCacheBindGroups._NumBindGroupsNoLookupCurrentFrame = 0;\n//# sourceMappingURL=webgpuCacheBindGroups.js.map","// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nconst name = \"clearQuadVertexShader\";\nconst shader = `uniform depthValue: f32;const pos=array(\nvec2f(-1.0,1.0),\nvec2f(1.0,1.0),\nvec2f(-1.0,-1.0),\nvec2f(1.0,-1.0)\n);\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvertexOutputs.position=vec4f(pos[input.vertexIndex],uniforms.depthValue,1.0);\n#define CUSTOM_VERTEX_MAIN_END\n}\n`;\n// Sideeffect\nShaderStore.ShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const clearQuadVertexShaderWGSL = { name, shader };\n//# sourceMappingURL=clearQuad.vertex.js.map","// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nconst name = \"clearQuadPixelShader\";\nconst shader = `uniform color: vec4f;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {fragmentOutputs.color=uniforms.color;}\n`;\n// Sideeffect\nShaderStore.ShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const clearQuadPixelShaderWGSL = { name, shader };\n//# sourceMappingURL=clearQuad.fragment.js.map","import { Constants } from \"../constants\";\nimport { WebGPUCacheRenderPipelineTree } from \"./webgpuCacheRenderPipelineTree\";\nimport { WebGPUShaderProcessingContext } from \"./webgpuShaderProcessingContext\";\nimport { WebGPUTextureHelper } from \"./webgpuTextureHelper\";\nimport { renderableTextureFormatToIndex } from \"./webgpuTextureManager\";\nimport \"../../ShadersWGSL/clearQuad.vertex\";\nimport \"../../ShadersWGSL/clearQuad.fragment\";\n/** @internal */\nexport class WebGPUClearQuad {\n setDepthStencilFormat(format) {\n this._depthTextureFormat = format;\n this._cacheRenderPipeline.setDepthStencilFormat(format);\n }\n setColorFormat(format) {\n this._cacheRenderPipeline.setColorFormat(format);\n }\n setMRTAttachments(attachments, textureArray, textureCount) {\n this._cacheRenderPipeline.setMRT(textureArray, textureCount);\n this._cacheRenderPipeline.setMRTAttachments(attachments);\n }\n constructor(device, engine, emptyVertexBuffer) {\n this._bindGroups = {};\n this._bundleCache = {};\n this._keyTemp = [];\n this._device = device;\n this._engine = engine;\n this._cacheRenderPipeline = new WebGPUCacheRenderPipelineTree(this._device, emptyVertexBuffer);\n this._cacheRenderPipeline.setDepthTestEnabled(false);\n this._cacheRenderPipeline.setStencilReadMask(0xff);\n this._effect = engine.createEffect(\"clearQuad\", [], [\"color\", \"depthValue\"], undefined, undefined, undefined, undefined, undefined, undefined, 1 /* ShaderLanguage.WGSL */);\n }\n clear(renderPass, clearColor, clearDepth, clearStencil, sampleCount = 1) {\n let renderPass2;\n let bundle = null;\n let bundleKey;\n const isRTTPass = !!this._engine._currentRenderTarget;\n if (renderPass) {\n renderPass2 = renderPass;\n }\n else {\n let idx = 0;\n this._keyTemp.length = 0;\n for (let i = 0; i < this._cacheRenderPipeline.colorFormats.length; ++i) {\n this._keyTemp[idx++] = renderableTextureFormatToIndex[this._cacheRenderPipeline.colorFormats[i] ?? \"\"];\n }\n const depthStencilFormatIndex = renderableTextureFormatToIndex[this._depthTextureFormat ?? 0];\n this._keyTemp[idx] =\n (clearColor ? clearColor.r + clearColor.g * 256 + clearColor.b * 256 * 256 + clearColor.a * 256 * 256 * 256 : 0) +\n (clearDepth ? 2 ** 32 : 0) +\n (clearStencil ? 2 ** 33 : 0) +\n (this._engine.useReverseDepthBuffer ? 2 ** 34 : 0) +\n (isRTTPass ? 2 ** 35 : 0) +\n (sampleCount > 1 ? 2 ** 36 : 0) +\n depthStencilFormatIndex * 2 ** 37;\n bundleKey = this._keyTemp.join(\"_\");\n bundle = this._bundleCache[bundleKey];\n if (bundle) {\n return bundle;\n }\n renderPass2 = this._device.createRenderBundleEncoder({\n label: \"clearQuadRenderBundle\",\n colorFormats: this._cacheRenderPipeline.colorFormats,\n depthStencilFormat: this._depthTextureFormat,\n sampleCount: WebGPUTextureHelper.GetSample(sampleCount),\n });\n }\n this._cacheRenderPipeline.setDepthWriteEnabled(!!clearDepth);\n this._cacheRenderPipeline.setStencilEnabled(!!clearStencil && !!this._depthTextureFormat && WebGPUTextureHelper.HasStencilAspect(this._depthTextureFormat));\n this._cacheRenderPipeline.setStencilWriteMask(clearStencil ? 0xff : 0);\n this._cacheRenderPipeline.setStencilCompare(clearStencil ? Constants.ALWAYS : Constants.NEVER);\n this._cacheRenderPipeline.setStencilPassOp(clearStencil ? Constants.REPLACE : Constants.KEEP);\n this._cacheRenderPipeline.setWriteMask(clearColor ? 0xf : 0);\n const pipeline = this._cacheRenderPipeline.getRenderPipeline(Constants.MATERIAL_TriangleStripDrawMode, this._effect, sampleCount);\n const webgpuPipelineContext = this._effect._pipelineContext;\n if (clearColor) {\n this._effect.setDirectColor4(\"color\", clearColor);\n }\n this._effect.setFloat(\"depthValue\", this._engine.useReverseDepthBuffer ? this._engine._clearReverseDepthValue : this._engine._clearDepthValue);\n webgpuPipelineContext.uniformBuffer.update();\n const bufferInternals = isRTTPass ? this._engine._ubInvertY : this._engine._ubDontInvertY;\n const bufferLeftOver = webgpuPipelineContext.uniformBuffer.getBuffer();\n const key = bufferLeftOver.uniqueId + \"-\" + bufferInternals.uniqueId;\n let bindGroups = this._bindGroups[key];\n if (!bindGroups) {\n const bindGroupLayouts = webgpuPipelineContext.bindGroupLayouts[0];\n bindGroups = this._bindGroups[key] = [];\n bindGroups.push(this._device.createBindGroup({\n label: `clearQuadBindGroup0-${key}`,\n layout: bindGroupLayouts[0],\n entries: [],\n }));\n if (!WebGPUShaderProcessingContext._SimplifiedKnownBindings) {\n bindGroups.push(this._device.createBindGroup({\n label: `clearQuadBindGroup1-${key}`,\n layout: bindGroupLayouts[1],\n entries: [],\n }));\n }\n bindGroups.push(this._device.createBindGroup({\n label: `clearQuadBindGroup${WebGPUShaderProcessingContext._SimplifiedKnownBindings ? 1 : 2}-${key}`,\n layout: bindGroupLayouts[WebGPUShaderProcessingContext._SimplifiedKnownBindings ? 1 : 2],\n entries: [\n {\n binding: 0,\n resource: {\n buffer: bufferInternals.underlyingResource,\n size: bufferInternals.capacity,\n },\n },\n {\n binding: 1,\n resource: {\n buffer: bufferLeftOver.underlyingResource,\n size: bufferLeftOver.capacity,\n },\n },\n ],\n }));\n }\n renderPass2.setPipeline(pipeline);\n for (let i = 0; i < bindGroups.length; ++i) {\n renderPass2.setBindGroup(i, bindGroups[i]);\n }\n renderPass2.draw(4, 1, 0, 0);\n if (!renderPass) {\n bundle = renderPass2.finish();\n this._bundleCache[bundleKey] = bundle;\n }\n return bundle;\n }\n}\n//# sourceMappingURL=webgpuClearQuad.js.map","import { WebGPUTextureHelper } from \"./webgpuTextureHelper\";\n/** @internal */\nexport class WebGPURenderItemViewport {\n constructor(x, y, w, h) {\n this.x = Math.floor(x);\n this.y = Math.floor(y);\n this.w = Math.floor(w);\n this.h = Math.floor(h);\n }\n run(renderPass) {\n renderPass.setViewport(this.x, this.y, this.w, this.h, 0, 1);\n }\n clone() {\n return new WebGPURenderItemViewport(this.x, this.y, this.w, this.h);\n }\n}\n/** @internal */\nexport class WebGPURenderItemScissor {\n constructor(x, y, w, h) {\n this.x = x;\n this.y = y;\n this.w = w;\n this.h = h;\n }\n run(renderPass) {\n renderPass.setScissorRect(this.x, this.y, this.w, this.h);\n }\n clone() {\n return new WebGPURenderItemScissor(this.x, this.y, this.w, this.h);\n }\n}\n/** @internal */\nexport class WebGPURenderItemStencilRef {\n constructor(ref) {\n this.ref = ref;\n }\n run(renderPass) {\n renderPass.setStencilReference(this.ref);\n }\n clone() {\n return new WebGPURenderItemStencilRef(this.ref);\n }\n}\n/** @internal */\nexport class WebGPURenderItemBlendColor {\n constructor(color) {\n this.color = color;\n }\n run(renderPass) {\n renderPass.setBlendConstant(this.color);\n }\n clone() {\n return new WebGPURenderItemBlendColor(this.color);\n }\n}\n/** @internal */\nexport class WebGPURenderItemBeginOcclusionQuery {\n constructor(query) {\n this.query = query;\n }\n run(renderPass) {\n renderPass.beginOcclusionQuery(this.query);\n }\n clone() {\n return new WebGPURenderItemBeginOcclusionQuery(this.query);\n }\n}\n/** @internal */\nexport class WebGPURenderItemEndOcclusionQuery {\n constructor() { }\n run(renderPass) {\n renderPass.endOcclusionQuery();\n }\n clone() {\n return new WebGPURenderItemEndOcclusionQuery();\n }\n}\nclass WebGPURenderItemBundles {\n constructor() {\n this.bundles = [];\n }\n run(renderPass) {\n renderPass.executeBundles(this.bundles);\n }\n clone() {\n const cloned = new WebGPURenderItemBundles();\n cloned.bundles = this.bundles;\n return cloned;\n }\n}\n/** @internal */\nexport class WebGPUBundleList {\n constructor(device) {\n this.numDrawCalls = 0;\n this._device = device;\n this._list = new Array(10);\n this._listLength = 0;\n }\n addBundle(bundle) {\n if (!this._currentItemIsBundle) {\n const item = new WebGPURenderItemBundles();\n this._list[this._listLength++] = item;\n this._currentBundleList = item.bundles;\n this._currentItemIsBundle = true;\n }\n if (bundle) {\n this._currentBundleList.push(bundle);\n }\n }\n _finishBundle() {\n if (this._currentItemIsBundle && this._bundleEncoder) {\n this._currentBundleList.push(this._bundleEncoder.finish());\n this._bundleEncoder = undefined;\n this._currentItemIsBundle = false;\n }\n }\n addItem(item) {\n this._finishBundle();\n this._list[this._listLength++] = item;\n this._currentItemIsBundle = false;\n }\n getBundleEncoder(colorFormats, depthStencilFormat, sampleCount) {\n if (!this._currentItemIsBundle) {\n this.addBundle();\n this._bundleEncoder = this._device.createRenderBundleEncoder({\n colorFormats,\n depthStencilFormat,\n sampleCount: WebGPUTextureHelper.GetSample(sampleCount),\n });\n }\n return this._bundleEncoder;\n }\n close() {\n this._finishBundle();\n }\n run(renderPass) {\n this.close();\n for (let i = 0; i < this._listLength; ++i) {\n this._list[i].run(renderPass);\n }\n }\n reset() {\n this._listLength = 0;\n this._currentItemIsBundle = false;\n this.numDrawCalls = 0;\n }\n clone() {\n this.close();\n const cloned = new WebGPUBundleList(this._device);\n cloned._list = new Array(this._listLength);\n cloned._listLength = this._listLength;\n cloned.numDrawCalls = this.numDrawCalls;\n for (let i = 0; i < this._listLength; ++i) {\n cloned._list[i] = this._list[i].clone();\n }\n return cloned;\n }\n}\n//# sourceMappingURL=webgpuBundleList.js.map","import * as WebGPUConstants from \"./webgpuConstants\";\n/** @internal */\nexport class WebGPUQuerySet {\n get querySet() {\n return this._querySet;\n }\n constructor(engine, count, type, device, bufferManager, canUseMultipleBuffers = true, label) {\n this._dstBuffers = [];\n this._engine = engine;\n this._device = device;\n this._bufferManager = bufferManager;\n this._count = count;\n this._canUseMultipleBuffers = canUseMultipleBuffers;\n this._querySet = device.createQuerySet({\n label: label ?? \"QuerySet\",\n type,\n count,\n });\n this._queryBuffer = bufferManager.createRawBuffer(8 * count, WebGPUConstants.BufferUsage.QueryResolve | WebGPUConstants.BufferUsage.CopySrc, undefined, \"QueryBuffer\");\n if (!canUseMultipleBuffers) {\n this._dstBuffers.push(this._bufferManager.createRawBuffer(8 * this._count, WebGPUConstants.BufferUsage.MapRead | WebGPUConstants.BufferUsage.CopyDst, undefined, \"QueryBufferNoMultipleBuffers\"));\n }\n }\n _getBuffer(firstQuery, queryCount) {\n if (!this._canUseMultipleBuffers && this._dstBuffers.length === 0) {\n return null;\n }\n const encoderResult = this._device.createCommandEncoder();\n let buffer;\n if (this._dstBuffers.length === 0) {\n buffer = this._bufferManager.createRawBuffer(8 * this._count, WebGPUConstants.BufferUsage.MapRead | WebGPUConstants.BufferUsage.CopyDst, undefined, \"QueryBufferAdditionalBuffer\");\n }\n else {\n buffer = this._dstBuffers[this._dstBuffers.length - 1];\n this._dstBuffers.length--;\n }\n encoderResult.resolveQuerySet(this._querySet, firstQuery, queryCount, this._queryBuffer, 0);\n encoderResult.copyBufferToBuffer(this._queryBuffer, 0, buffer, 0, 8 * queryCount);\n this._device.queue.submit([encoderResult.finish()]);\n return buffer;\n }\n async readValues(firstQuery = 0, queryCount = 1) {\n const buffer = this._getBuffer(firstQuery, queryCount);\n if (buffer === null) {\n return null;\n }\n const engineId = this._engine.uniqueId;\n return buffer.mapAsync(1 /* WebGPUConstants.MapMode.Read */).then(() => {\n const arrayBuf = new BigUint64Array(buffer.getMappedRange()).slice();\n buffer.unmap();\n this._dstBuffers[this._dstBuffers.length] = buffer;\n return arrayBuf;\n }, (err) => {\n if (this._engine.isDisposed || this._engine.uniqueId !== engineId) {\n // Engine disposed or context loss/restoration\n return null;\n }\n throw err;\n });\n }\n async readValue(firstQuery = 0) {\n const buffer = this._getBuffer(firstQuery, 1);\n if (buffer === null) {\n return null;\n }\n const engineId = this._engine.uniqueId;\n return buffer.mapAsync(1 /* WebGPUConstants.MapMode.Read */).then(() => {\n const arrayBuf = new BigUint64Array(buffer.getMappedRange());\n const value = Number(arrayBuf[0]);\n buffer.unmap();\n this._dstBuffers[this._dstBuffers.length] = buffer;\n return value;\n }, (err) => {\n if (this._engine.isDisposed || this._engine.uniqueId !== engineId) {\n // Engine disposed or context loss/restoration\n return 0;\n }\n throw err;\n });\n }\n async readTwoValuesAndSubtract(firstQuery = 0) {\n const buffer = this._getBuffer(firstQuery, 2);\n if (buffer === null) {\n return null;\n }\n const engineId = this._engine.uniqueId;\n return buffer.mapAsync(1 /* WebGPUConstants.MapMode.Read */).then(() => {\n const arrayBuf = new BigUint64Array(buffer.getMappedRange());\n const value = Number(arrayBuf[1] - arrayBuf[0]);\n buffer.unmap();\n this._dstBuffers[this._dstBuffers.length] = buffer;\n return value;\n }, (err) => {\n if (this._engine.isDisposed || this._engine.uniqueId !== engineId) {\n // Engine disposed or context loss/restoration\n return 0;\n }\n throw err;\n });\n }\n dispose() {\n this._querySet.destroy();\n this._bufferManager.releaseBuffer(this._queryBuffer);\n for (let i = 0; i < this._dstBuffers.length; ++i) {\n this._bufferManager.releaseBuffer(this._dstBuffers[i]);\n }\n }\n}\n//# sourceMappingURL=webgpuQuerySet.js.map","import { PerfCounter } from \"../../Misc/perfCounter\";\nimport { WebGPUQuerySet } from \"./webgpuQuerySet\";\nimport { Logger } from \"core/Misc/logger\";\n/** @internal */\nexport class WebGPUTimestampQuery {\n get gpuFrameTimeCounter() {\n return this._gpuFrameTimeCounter;\n }\n constructor(engine, device, bufferManager) {\n this._enabled = false;\n this._gpuFrameTimeCounter = new PerfCounter();\n this._measureDurationState = 0;\n this._engine = engine;\n this._device = device;\n this._bufferManager = bufferManager;\n }\n get enable() {\n return this._enabled;\n }\n set enable(value) {\n if (this._enabled === value) {\n return;\n }\n this._enabled = value;\n this._measureDurationState = 0;\n if (value) {\n try {\n this._measureDuration = new WebGPUDurationMeasure(this._engine, this._device, this._bufferManager, 2000, \"QuerySet_TimestampQuery\");\n }\n catch (e) {\n this._enabled = false;\n Logger.Error(\"Could not create a WebGPUDurationMeasure!\\nError: \" + e.message + \"\\nMake sure timestamp query is supported and enabled in your browser.\");\n return;\n }\n }\n else {\n this._measureDuration.dispose();\n }\n }\n startFrame(commandEncoder) {\n if (this._enabled && this._measureDurationState === 0) {\n this._measureDuration.start(commandEncoder);\n this._measureDurationState = 1;\n }\n }\n endFrame(commandEncoder) {\n if (this._measureDurationState === 1) {\n this._measureDurationState = 2;\n this._measureDuration.stop(commandEncoder).then((duration) => {\n if (duration !== null && duration >= 0) {\n this._gpuFrameTimeCounter.fetchNewFrame();\n this._gpuFrameTimeCounter.addCount(duration, true);\n }\n this._measureDurationState = 0;\n });\n }\n }\n startPass(descriptor, index) {\n if (this._enabled) {\n this._measureDuration.startPass(descriptor, index);\n }\n else {\n descriptor.timestampWrites = undefined;\n }\n }\n endPass(index, gpuPerfCounter) {\n if (!this._enabled || !gpuPerfCounter) {\n return;\n }\n const currentFrameId = this._engine.frameId;\n this._measureDuration.stopPass(index).then((duration_) => {\n gpuPerfCounter._addDuration(currentFrameId, duration_ !== null && duration_ > 0 ? duration_ : 0);\n });\n }\n dispose() {\n this._measureDuration?.dispose();\n }\n}\n/** @internal */\nexport class WebGPUDurationMeasure {\n constructor(engine, device, bufferManager, count = 2, querySetLabel) {\n this._count = count;\n this._querySet = new WebGPUQuerySet(engine, count, \"timestamp\" /* WebGPUConstants.QueryType.Timestamp */, device, bufferManager, true, querySetLabel);\n }\n start(encoder) {\n encoder.writeTimestamp?.(this._querySet.querySet, 0);\n }\n async stop(encoder) {\n encoder.writeTimestamp?.(this._querySet.querySet, 1);\n return encoder.writeTimestamp ? this._querySet.readTwoValuesAndSubtract(0) : 0;\n }\n startPass(descriptor, index) {\n if (index + 3 > this._count) {\n throw new Error(\"WebGPUDurationMeasure: index out of range (\" + index + \")\");\n }\n descriptor.timestampWrites = {\n querySet: this._querySet.querySet,\n beginningOfPassWriteIndex: index + 2,\n endOfPassWriteIndex: index + 3,\n };\n }\n async stopPass(index) {\n return this._querySet.readTwoValuesAndSubtract(index + 2);\n }\n dispose() {\n this._querySet.dispose();\n }\n}\n//# sourceMappingURL=webgpuTimestampQuery.js.map","import { WebGPUQuerySet } from \"./webgpuQuerySet\";\n/** @internal */\nexport class WebGPUOcclusionQuery {\n get querySet() {\n return this._querySet.querySet;\n }\n get hasQueries() {\n return this._currentTotalIndices !== this._availableIndices.length;\n }\n canBeginQuery(index) {\n if (this._frameQuerySetIsDirty === this._engine.frameId || this._queryFrameId[index] === this._engine.frameId) {\n return false;\n }\n const canBegin = this._engine._getCurrentRenderPassWrapper().renderPassDescriptor.occlusionQuerySet !== undefined;\n if (canBegin) {\n this._queryFrameId[index] = this._engine.frameId;\n }\n return canBegin;\n }\n constructor(engine, device, bufferManager, startCount = 50, incrementCount = 100) {\n this._availableIndices = [];\n this._frameQuerySetIsDirty = -1;\n this._queryFrameId = [];\n this._engine = engine;\n this._device = device;\n this._bufferManager = bufferManager;\n this._frameLastBuffer = -1;\n this._currentTotalIndices = 0;\n this._countIncrement = incrementCount;\n this._allocateNewIndices(startCount);\n }\n createQuery() {\n if (this._availableIndices.length === 0) {\n this._allocateNewIndices();\n }\n const index = this._availableIndices[this._availableIndices.length - 1];\n this._availableIndices.length--;\n return index;\n }\n deleteQuery(index) {\n this._availableIndices[this._availableIndices.length] = index;\n }\n isQueryResultAvailable(index) {\n this._retrieveQueryBuffer();\n return !!this._lastBuffer && index < this._lastBuffer.length;\n }\n getQueryResult(index) {\n return Number(this._lastBuffer?.[index] ?? -1);\n }\n _retrieveQueryBuffer() {\n if (this._lastBuffer && this._frameLastBuffer === this._engine.frameId) {\n return;\n }\n if (this._frameLastBuffer !== this._engine.frameId) {\n this._frameLastBuffer = this._engine.frameId;\n this._querySet.readValues(0, this._currentTotalIndices).then((arrayBuffer) => {\n this._lastBuffer = arrayBuffer;\n });\n }\n }\n _allocateNewIndices(numIndices) {\n numIndices = numIndices ?? this._countIncrement;\n this._delayQuerySetDispose();\n for (let i = 0; i < numIndices; ++i) {\n this._availableIndices.push(this._currentTotalIndices + i);\n }\n this._currentTotalIndices += numIndices;\n this._querySet = new WebGPUQuerySet(this._engine, this._currentTotalIndices, \"occlusion\" /* WebGPUConstants.QueryType.Occlusion */, this._device, this._bufferManager, false, \"QuerySet_OcclusionQuery_count_\" + this._currentTotalIndices);\n this._frameQuerySetIsDirty = this._engine.frameId;\n }\n _delayQuerySetDispose() {\n const querySet = this._querySet;\n if (querySet) {\n // Wait a bit before disposing of the queryset, in case some queries are still running for it\n setTimeout(() => querySet.dispose, 1000);\n }\n }\n dispose() {\n this._querySet?.dispose();\n this._availableIndices.length = 0;\n }\n}\n//# sourceMappingURL=webgpuOcclusionQuery.js.map","import { Logger } from \"core/Misc/logger\";\nimport { EscapeRegExp, ExtractBetweenMarkers, FindBackward, IsIdentifierChar, RemoveComments, SkipWhitespaces } from \"../../Misc/codeStringParsingTools\";\n/**\n * Class used to inline functions in shader code\n */\nexport class ShaderCodeInliner {\n /** Gets the code after the inlining process */\n get code() {\n return this._sourceCode;\n }\n /**\n * Initializes the inliner\n * @param sourceCode shader code source to inline\n * @param numMaxIterations maximum number of iterations (used to detect recursive calls)\n */\n constructor(sourceCode, numMaxIterations = 20) {\n /** Gets or sets the debug mode */\n this.debug = false;\n this._sourceCode = sourceCode;\n this._numMaxIterations = numMaxIterations;\n this._functionDescr = [];\n this.inlineToken = \"#define inline\";\n }\n /**\n * Start the processing of the shader code\n */\n processCode() {\n if (this.debug) {\n Logger.Log(`Start inlining process (code size=${this._sourceCode.length})...`);\n }\n this._collectFunctions();\n this._processInlining(this._numMaxIterations);\n if (this.debug) {\n Logger.Log(\"End of inlining process.\");\n }\n }\n _collectFunctions() {\n let startIndex = 0;\n while (startIndex < this._sourceCode.length) {\n // locate the function to inline and extract its name\n const inlineTokenIndex = this._sourceCode.indexOf(this.inlineToken, startIndex);\n if (inlineTokenIndex < 0) {\n break;\n }\n const funcParamsStartIndex = this._sourceCode.indexOf(\"(\", inlineTokenIndex + this.inlineToken.length);\n if (funcParamsStartIndex < 0) {\n if (this.debug) {\n Logger.Warn(`Could not find the opening parenthesis after the token. startIndex=${startIndex}`);\n }\n startIndex = inlineTokenIndex + this.inlineToken.length;\n continue;\n }\n const funcNameMatch = ShaderCodeInliner._RegexpFindFunctionNameAndType.exec(this._sourceCode.substring(inlineTokenIndex + this.inlineToken.length, funcParamsStartIndex));\n if (!funcNameMatch) {\n if (this.debug) {\n Logger.Warn(`Could not extract the name/type of the function from: ${this._sourceCode.substring(inlineTokenIndex + this.inlineToken.length, funcParamsStartIndex)}`);\n }\n startIndex = inlineTokenIndex + this.inlineToken.length;\n continue;\n }\n const [funcType, funcName] = [funcNameMatch[3], funcNameMatch[4]];\n // extract the parameters of the function as a whole string (without the leading / trailing parenthesis)\n const funcParamsEndIndex = ExtractBetweenMarkers(\"(\", \")\", this._sourceCode, funcParamsStartIndex);\n if (funcParamsEndIndex < 0) {\n if (this.debug) {\n Logger.Warn(`Could not extract the parameters the function '${funcName}' (type=${funcType}). funcParamsStartIndex=${funcParamsStartIndex}`);\n }\n startIndex = inlineTokenIndex + this.inlineToken.length;\n continue;\n }\n const funcParams = this._sourceCode.substring(funcParamsStartIndex + 1, funcParamsEndIndex);\n // extract the body of the function (with the curly brackets)\n const funcBodyStartIndex = SkipWhitespaces(this._sourceCode, funcParamsEndIndex + 1);\n if (funcBodyStartIndex === this._sourceCode.length) {\n if (this.debug) {\n Logger.Warn(`Could not extract the body of the function '${funcName}' (type=${funcType}). funcParamsEndIndex=${funcParamsEndIndex}`);\n }\n startIndex = inlineTokenIndex + this.inlineToken.length;\n continue;\n }\n const funcBodyEndIndex = ExtractBetweenMarkers(\"{\", \"}\", this._sourceCode, funcBodyStartIndex);\n if (funcBodyEndIndex < 0) {\n if (this.debug) {\n Logger.Warn(`Could not extract the body of the function '${funcName}' (type=${funcType}). funcBodyStartIndex=${funcBodyStartIndex}`);\n }\n startIndex = inlineTokenIndex + this.inlineToken.length;\n continue;\n }\n const funcBody = this._sourceCode.substring(funcBodyStartIndex, funcBodyEndIndex + 1);\n // process the parameters: extract each names\n const params = RemoveComments(funcParams).split(\",\");\n const paramNames = [];\n for (let p = 0; p < params.length; ++p) {\n const param = params[p].trim();\n const idx = param.lastIndexOf(\" \");\n if (idx >= 0) {\n paramNames.push(param.substring(idx + 1));\n }\n }\n if (funcType !== \"void\") {\n // for functions that return a value, we will replace \"return\" by \"tempvarname = \", tempvarname being a unique generated name\n paramNames.push(\"return\");\n }\n // collect the function\n this._functionDescr.push({\n name: funcName,\n type: funcType,\n parameters: paramNames,\n body: funcBody,\n callIndex: 0,\n });\n startIndex = funcBodyEndIndex + 1;\n // remove the function from the source code\n const partBefore = inlineTokenIndex > 0 ? this._sourceCode.substring(0, inlineTokenIndex) : \"\";\n const partAfter = funcBodyEndIndex + 1 < this._sourceCode.length - 1 ? this._sourceCode.substring(funcBodyEndIndex + 1) : \"\";\n this._sourceCode = partBefore + partAfter;\n startIndex -= funcBodyEndIndex + 1 - inlineTokenIndex;\n }\n if (this.debug) {\n Logger.Log(`Collect functions: ${this._functionDescr.length} functions found. functionDescr=${this._functionDescr}`);\n }\n }\n _processInlining(numMaxIterations = 20) {\n while (numMaxIterations-- >= 0) {\n if (!this._replaceFunctionCallsByCode()) {\n break;\n }\n }\n if (this.debug) {\n Logger.Log(`numMaxIterations is ${numMaxIterations} after inlining process`);\n }\n return numMaxIterations >= 0;\n }\n _replaceFunctionCallsByCode() {\n let doAgain = false;\n for (const func of this._functionDescr) {\n const { name, type, parameters, body } = func;\n let startIndex = 0;\n while (startIndex < this._sourceCode.length) {\n // Look for the function name in the source code\n const functionCallIndex = this._sourceCode.indexOf(name, startIndex);\n if (functionCallIndex < 0) {\n break;\n }\n // Make sure \"name\" is not part of a bigger string\n if (functionCallIndex === 0 || IsIdentifierChar(this._sourceCode.charAt(functionCallIndex - 1))) {\n startIndex = functionCallIndex + name.length;\n continue;\n }\n // Find the opening parenthesis\n const callParamsStartIndex = SkipWhitespaces(this._sourceCode, functionCallIndex + name.length);\n if (callParamsStartIndex === this._sourceCode.length || this._sourceCode.charAt(callParamsStartIndex) !== \"(\") {\n startIndex = functionCallIndex + name.length;\n continue;\n }\n // extract the parameters of the function call as a whole string (without the leading / trailing parenthesis)\n const callParamsEndIndex = ExtractBetweenMarkers(\"(\", \")\", this._sourceCode, callParamsStartIndex);\n if (callParamsEndIndex < 0) {\n if (this.debug) {\n Logger.Warn(`Could not extract the parameters of the function call. Function '${name}' (type=${type}). callParamsStartIndex=${callParamsStartIndex}`);\n }\n startIndex = functionCallIndex + name.length;\n continue;\n }\n const callParams = this._sourceCode.substring(callParamsStartIndex + 1, callParamsEndIndex);\n // process the parameter call: extract each names\n // this function split the parameter list used in the function call at ',' boundaries by taking care of potential parenthesis like in:\n // myfunc(a, vec2(1., 0.), 4.)\n const splitParameterCall = (s) => {\n const parameters = [];\n let curIdx = 0, startParamIdx = 0;\n while (curIdx < s.length) {\n if (s.charAt(curIdx) === \"(\") {\n const idx2 = ExtractBetweenMarkers(\"(\", \")\", s, curIdx);\n if (idx2 < 0) {\n return null;\n }\n curIdx = idx2;\n }\n else if (s.charAt(curIdx) === \",\") {\n parameters.push(s.substring(startParamIdx, curIdx));\n startParamIdx = curIdx + 1;\n }\n curIdx++;\n }\n if (startParamIdx < curIdx) {\n parameters.push(s.substring(startParamIdx, curIdx));\n }\n return parameters;\n };\n const params = splitParameterCall(RemoveComments(callParams));\n if (params === null) {\n if (this.debug) {\n Logger.Warn(`Invalid function call: can't extract the parameters of the function call. Function '${name}' (type=${type}). callParamsStartIndex=${callParamsStartIndex}, callParams=` +\n callParams);\n }\n startIndex = functionCallIndex + name.length;\n continue;\n }\n const paramNames = [];\n for (let p = 0; p < params.length; ++p) {\n const param = params[p].trim();\n paramNames.push(param);\n }\n const retParamName = type !== \"void\" ? name + \"_\" + func.callIndex++ : null;\n if (retParamName) {\n paramNames.push(retParamName + \" =\");\n }\n if (paramNames.length !== parameters.length) {\n if (this.debug) {\n Logger.Warn(`Invalid function call: not the same number of parameters for the call than the number expected by the function. Function '${name}' (type=${type}). function parameters=${parameters}, call parameters=${paramNames}`);\n }\n startIndex = functionCallIndex + name.length;\n continue;\n }\n startIndex = callParamsEndIndex + 1;\n // replace the function call by the body function\n const funcBody = this._replaceNames(body, parameters, paramNames);\n let partBefore = functionCallIndex > 0 ? this._sourceCode.substring(0, functionCallIndex) : \"\";\n const partAfter = callParamsEndIndex + 1 < this._sourceCode.length - 1 ? this._sourceCode.substring(callParamsEndIndex + 1) : \"\";\n if (retParamName) {\n // case where the function returns a value. We generate:\n // FUNCTYPE retParamName;\n // {function body}\n // and replace the function call by retParamName\n const injectDeclarationIndex = FindBackward(this._sourceCode, functionCallIndex - 1, \"\\n\", \"{\");\n partBefore = this._sourceCode.substring(0, injectDeclarationIndex + 1);\n const partBetween = this._sourceCode.substring(injectDeclarationIndex + 1, functionCallIndex);\n this._sourceCode = partBefore + type + \" \" + retParamName + \";\\n\" + funcBody + \"\\n\" + partBetween + retParamName + partAfter;\n if (this.debug) {\n Logger.Log(`Replace function call by code. Function '${name}' (type=${type}). injectDeclarationIndex=${injectDeclarationIndex}, call parameters=${paramNames}`);\n }\n }\n else {\n // simple case where the return value of the function is \"void\"\n this._sourceCode = partBefore + funcBody + partAfter;\n startIndex += funcBody.length - (callParamsEndIndex + 1 - functionCallIndex);\n if (this.debug) {\n Logger.Log(`Replace function call by code. Function '${name}' (type=${type}). functionCallIndex=${functionCallIndex}, call parameters=${paramNames}`);\n }\n }\n doAgain = true;\n }\n }\n return doAgain;\n }\n _replaceNames(code, sources, destinations) {\n for (let i = 0; i < sources.length; ++i) {\n const source = new RegExp(EscapeRegExp(sources[i]), \"g\"), sourceLen = sources[i].length, destination = destinations[i];\n code = code.replace(source, (match, ...args) => {\n const offset = args[0];\n // Make sure \"source\" is not part of a bigger identifier (for eg, if source=view and we matched it with viewDirection)\n if (IsIdentifierChar(code.charAt(offset - 1)) || IsIdentifierChar(code.charAt(offset + sourceLen))) {\n return sources[i];\n }\n return destination;\n });\n }\n return code;\n }\n}\nShaderCodeInliner._RegexpFindFunctionNameAndType = /((\\s+?)(\\w+)\\s+(\\w+)\\s*?)$/;\n//# sourceMappingURL=shaderCodeInliner.js.map","import { Logger } from \"core/Misc/logger\";\nimport { Tools } from \"../../Misc/tools\";\n/** @internal */\nexport class WebGPUTintWASM {\n async initTwgsl(twgslOptions) {\n if (WebGPUTintWASM._Twgsl) {\n return;\n }\n twgslOptions = twgslOptions || {};\n twgslOptions = {\n ...WebGPUTintWASM._TWgslDefaultOptions,\n ...twgslOptions,\n };\n if (twgslOptions.twgsl) {\n WebGPUTintWASM._Twgsl = twgslOptions.twgsl;\n return Promise.resolve();\n }\n if (twgslOptions.jsPath && twgslOptions.wasmPath) {\n await Tools.LoadBabylonScriptAsync(twgslOptions.jsPath);\n }\n if (self.twgsl) {\n WebGPUTintWASM._Twgsl = await self.twgsl(Tools.GetBabylonScriptURL(twgslOptions.wasmPath));\n return Promise.resolve();\n }\n return Promise.reject(\"twgsl is not available.\");\n }\n convertSpirV2WGSL(code, disableUniformityAnalysis = false) {\n const ccode = WebGPUTintWASM._Twgsl.convertSpirV2WGSL(code, WebGPUTintWASM.DisableUniformityAnalysis || disableUniformityAnalysis);\n if (WebGPUTintWASM.ShowWGSLShaderCode) {\n Logger.Log(ccode);\n Logger.Log(\"***********************************************\");\n }\n return WebGPUTintWASM.DisableUniformityAnalysis || disableUniformityAnalysis ? \"diagnostic(off, derivative_uniformity);\\n\" + ccode : ccode;\n }\n}\n// Default twgsl options.\nWebGPUTintWASM._TWgslDefaultOptions = {\n jsPath: `${Tools._DefaultCdnUrl}/twgsl/twgsl.js`,\n wasmPath: `${Tools._DefaultCdnUrl}/twgsl/twgsl.wasm`,\n};\nWebGPUTintWASM.ShowWGSLShaderCode = false;\nWebGPUTintWASM.DisableUniformityAnalysis = false;\nWebGPUTintWASM._Twgsl = null;\n//# sourceMappingURL=webgpuTintWASM.js.map","import { Constants } from \"../constants\";\n/** @internal */\nexport class WebGPUSnapshotRendering {\n constructor(engine, renderingMode, bundleList) {\n this._record = false;\n this._play = false;\n this._playBundleListIndex = 0;\n this._allBundleLists = [];\n this._enabled = false;\n this._engine = engine;\n this._mode = renderingMode;\n this._bundleList = bundleList;\n }\n get enabled() {\n return this._enabled;\n }\n get play() {\n return this._play;\n }\n get record() {\n return this._record;\n }\n set enabled(activate) {\n this._allBundleLists.length = 0;\n this._record = this._enabled = activate;\n this._play = false;\n if (activate) {\n this._modeSaved = this._mode;\n this._mode = Constants.SNAPSHOTRENDERING_STANDARD; // need to reset to standard for the recording pass to avoid some code being bypassed\n }\n }\n get mode() {\n return this._mode;\n }\n set mode(mode) {\n if (this._record) {\n this._modeSaved = mode;\n }\n else {\n this._mode = mode;\n }\n }\n endRenderPass(currentRenderPass) {\n if (!this._record && !this._play) {\n // Snapshot rendering mode is not enabled\n return false;\n }\n let bundleList;\n if (this._record) {\n bundleList = this._bundleList.clone();\n this._allBundleLists.push(bundleList);\n this._bundleList.reset();\n }\n else {\n // We are playing the snapshot\n if (this._playBundleListIndex >= this._allBundleLists.length) {\n throw new Error(`Invalid playBundleListIndex! Your snapshot is no longer valid for the current frame, you should recreate a new one. playBundleListIndex=${this._playBundleListIndex}, allBundleLists.length=${this._allBundleLists.length}}`);\n }\n bundleList = this._allBundleLists[this._playBundleListIndex++];\n }\n bundleList.run(currentRenderPass);\n if (this._mode === Constants.SNAPSHOTRENDERING_FAST) {\n this._engine._reportDrawCall(bundleList.numDrawCalls);\n }\n return true;\n }\n endFrame() {\n if (this._record) {\n // We stop recording and switch to replay mode for the next frames\n this._record = false;\n this._play = true;\n this._mode = this._modeSaved;\n }\n this._playBundleListIndex = 0;\n }\n reset() {\n if (this._record) {\n this._mode = this._modeSaved;\n }\n this.enabled = false;\n this.enabled = true;\n }\n}\n//# sourceMappingURL=webgpuSnapshotRendering.js.map","import { Buffer, VertexBuffer } from \"./buffer\";\nconst isLittleEndian = (() => {\n const array = new Uint8Array(4);\n const view = new Uint32Array(array.buffer);\n return !!((view[0] = 1) & array[0]);\n})();\nObject.defineProperty(VertexBuffer.prototype, \"effectiveByteStride\", {\n get: function () {\n return (this._alignedBuffer && this._alignedBuffer.byteStride) || this.byteStride;\n },\n enumerable: true,\n configurable: true,\n});\nObject.defineProperty(VertexBuffer.prototype, \"effectiveByteOffset\", {\n get: function () {\n return this._alignedBuffer ? 0 : this.byteOffset;\n },\n enumerable: true,\n configurable: true,\n});\nObject.defineProperty(VertexBuffer.prototype, \"effectiveBuffer\", {\n get: function () {\n return (this._alignedBuffer && this._alignedBuffer.getBuffer()) || this._buffer.getBuffer();\n },\n enumerable: true,\n configurable: true,\n});\nVertexBuffer.prototype._rebuild = function () {\n this._buffer?._rebuild();\n this._alignedBuffer?._rebuild();\n};\nVertexBuffer.prototype.dispose = function () {\n if (this._ownsBuffer) {\n this._buffer.dispose();\n }\n this._alignedBuffer?.dispose();\n this._alignedBuffer = undefined;\n this._isDisposed = true;\n};\nVertexBuffer.prototype.getWrapperBuffer = function () {\n return this._alignedBuffer || this._buffer;\n};\nVertexBuffer.prototype._alignBuffer = function () {\n const data = this._buffer.getData();\n if (!this.engine._features.forceVertexBufferStrideAndOffsetMultiple4Bytes || (this.byteStride % 4 === 0 && this.byteOffset % 4 === 0) || !data) {\n return;\n }\n const typeByteLength = VertexBuffer.GetTypeByteLength(this.type);\n const alignedByteStride = (this.byteStride + 3) & ~3;\n const alignedSize = alignedByteStride / typeByteLength;\n const totalVertices = this._maxVerticesCount;\n const totalByteLength = totalVertices * alignedByteStride;\n const totalLength = totalByteLength / typeByteLength;\n let sourceData;\n if (Array.isArray(data)) {\n const sourceDataAsFloat = new Float32Array(data);\n sourceData = new DataView(sourceDataAsFloat.buffer, sourceDataAsFloat.byteOffset, sourceDataAsFloat.byteLength);\n }\n else if (data instanceof ArrayBuffer) {\n sourceData = new DataView(data, 0, data.byteLength);\n }\n else {\n sourceData = new DataView(data.buffer, data.byteOffset, data.byteLength);\n }\n let alignedData;\n if (this.type === VertexBuffer.BYTE) {\n alignedData = new Int8Array(totalLength);\n }\n else if (this.type === VertexBuffer.UNSIGNED_BYTE) {\n alignedData = new Uint8Array(totalLength);\n }\n else if (this.type === VertexBuffer.SHORT) {\n alignedData = new Int16Array(totalLength);\n }\n else if (this.type === VertexBuffer.UNSIGNED_SHORT) {\n alignedData = new Uint16Array(totalLength);\n }\n else if (this.type === VertexBuffer.INT) {\n alignedData = new Int32Array(totalLength);\n }\n else if (this.type === VertexBuffer.UNSIGNED_INT) {\n alignedData = new Uint32Array(totalLength);\n }\n else {\n alignedData = new Float32Array(totalLength);\n }\n const numComponents = this.getSize();\n let sourceOffset = this.byteOffset;\n for (let i = 0; i < totalVertices; ++i) {\n for (let j = 0; j < numComponents; ++j) {\n switch (this.type) {\n case VertexBuffer.BYTE:\n alignedData[i * alignedSize + j] = sourceData.getInt8(sourceOffset + j);\n break;\n case VertexBuffer.UNSIGNED_BYTE:\n alignedData[i * alignedSize + j] = sourceData.getUint8(sourceOffset + j);\n break;\n case VertexBuffer.SHORT:\n alignedData[i * alignedSize + j] = sourceData.getInt16(sourceOffset + j * 2, isLittleEndian);\n break;\n case VertexBuffer.UNSIGNED_SHORT:\n alignedData[i * alignedSize + j] = sourceData.getUint16(sourceOffset + j * 2, isLittleEndian);\n break;\n case VertexBuffer.INT:\n alignedData[i * alignedSize + j] = sourceData.getInt32(sourceOffset + j * 4, isLittleEndian);\n break;\n case VertexBuffer.UNSIGNED_INT:\n alignedData[i * alignedSize + j] = sourceData.getUint32(sourceOffset + j * 4, isLittleEndian);\n break;\n case VertexBuffer.FLOAT:\n alignedData[i * alignedSize + j] = sourceData.getFloat32(sourceOffset + j * 4, isLittleEndian);\n break;\n }\n }\n sourceOffset += this.byteStride;\n }\n this._alignedBuffer?.dispose();\n this._alignedBuffer = new Buffer(this.engine, alignedData, false, alignedByteStride, false, this.getIsInstanced(), true, this.instanceDivisor, (this._label ?? \"VertexBuffer\") + \"_aligned\");\n};\n//# sourceMappingURL=buffer.align.js.map","import { ExternalTexture } from \"../../Materials/Textures/externalTexture\";\n/**\n * Nothing specific to WebGPU in this class, but the spec is not final yet so let's remove it later on\n * if it is not needed\n * @internal\n **/\nexport class WebGPUExternalTexture extends ExternalTexture {\n constructor(video) {\n super(video);\n }\n}\n//# sourceMappingURL=webgpuExternalTexture.js.map","import { InternalTexture } from \"../../../Materials/Textures/internalTexture\";\nimport { Constants } from \"../../constants\";\nimport { Logger } from \"../../../Misc/logger\";\nimport { ThinWebGPUEngine } from \"core/Engines/thinWebGPUEngine\";\nThinWebGPUEngine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression = null, type = Constants.TEXTURETYPE_UNSIGNED_BYTE, creationFlags = 0, useSRGBBuffer = false) {\n const texture = new InternalTexture(this, 3 /* InternalTextureSource.Raw */);\n texture.baseWidth = width;\n texture.baseHeight = height;\n texture.width = width;\n texture.height = height;\n texture.format = format;\n texture.generateMipMaps = generateMipMaps;\n texture.samplingMode = samplingMode;\n texture.invertY = invertY;\n texture._compression = compression;\n texture.type = type;\n texture._creationFlags = creationFlags;\n texture._useSRGBBuffer = useSRGBBuffer;\n if (!this._doNotHandleContextLost) {\n texture._bufferView = data;\n }\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, undefined, creationFlags);\n this.updateRawTexture(texture, data, format, invertY, compression, type, useSRGBBuffer);\n this._internalTexturesCache.push(texture);\n return texture;\n};\nThinWebGPUEngine.prototype.updateRawTexture = function (texture, bufferView, format, invertY, compression = null, type = Constants.TEXTURETYPE_UNSIGNED_BYTE, useSRGBBuffer = false) {\n if (!texture) {\n return;\n }\n if (!this._doNotHandleContextLost) {\n texture._bufferView = bufferView;\n texture.invertY = invertY;\n texture._compression = compression;\n texture._useSRGBBuffer = useSRGBBuffer;\n }\n if (bufferView) {\n const gpuTextureWrapper = texture._hardwareTexture;\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\n if (needConversion) {\n bufferView = _convertRGBtoRGBATextureData(bufferView, texture.width, texture.height, type);\n }\n const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\n this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);\n if (texture.generateMipMaps) {\n this._generateMipmaps(texture, this._uploadEncoder);\n }\n }\n texture.isReady = true;\n};\nThinWebGPUEngine.prototype.createRawCubeTexture = function (data, size, format, type, generateMipMaps, invertY, samplingMode, compression = null) {\n const texture = new InternalTexture(this, 8 /* InternalTextureSource.CubeRaw */);\n if (type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {\n generateMipMaps = false;\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\n Logger.Warn(\"Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\");\n }\n else if (type === Constants.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {\n generateMipMaps = false;\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\n Logger.Warn(\"Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\");\n }\n else if (type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloatRender) {\n generateMipMaps = false;\n Logger.Warn(\"Render to float textures is not supported. Mipmap generation forced to false.\");\n }\n else if (type === Constants.TEXTURETYPE_HALF_FLOAT && !this._caps.colorBufferFloat) {\n generateMipMaps = false;\n Logger.Warn(\"Render to half float textures is not supported. Mipmap generation forced to false.\");\n }\n texture.isCube = true;\n texture._originalFormat = format;\n texture.format = format === Constants.TEXTUREFORMAT_RGB ? Constants.TEXTUREFORMAT_RGBA : format;\n texture.type = type;\n texture.generateMipMaps = generateMipMaps;\n texture.width = size;\n texture.height = size;\n texture.samplingMode = samplingMode;\n if (!this._doNotHandleContextLost) {\n texture._bufferViewArray = data;\n }\n texture.invertY = invertY;\n texture._compression = compression;\n texture._cachedWrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n texture._cachedWrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n this._textureHelper.createGPUTextureForInternalTexture(texture);\n if (format === Constants.TEXTUREFORMAT_RGB) {\n const gpuTextureWrapper = texture._hardwareTexture;\n gpuTextureWrapper._originalFormatIsRGB = true;\n }\n if (data) {\n this.updateRawCubeTexture(texture, data, format, type, invertY, compression);\n }\n texture.isReady = true;\n return texture;\n};\nThinWebGPUEngine.prototype.updateRawCubeTexture = function (texture, bufferView, _format, type, invertY, compression = null) {\n texture._bufferViewArray = bufferView;\n texture.invertY = invertY;\n texture._compression = compression;\n const gpuTextureWrapper = texture._hardwareTexture;\n const needConversion = gpuTextureWrapper._originalFormatIsRGB;\n const faces = [0, 2, 4, 1, 3, 5];\n const data = [];\n for (let i = 0; i < bufferView.length; ++i) {\n let faceData = bufferView[faces[i]];\n if (needConversion) {\n faceData = _convertRGBtoRGBATextureData(faceData, texture.width, texture.height, type);\n }\n data.push(new Uint8Array(faceData.buffer, faceData.byteOffset, faceData.byteLength));\n }\n this._textureHelper.updateCubeTextures(data, gpuTextureWrapper.underlyingResource, texture.width, texture.height, gpuTextureWrapper.format, invertY, false, 0, 0);\n if (texture.generateMipMaps) {\n this._generateMipmaps(texture, this._uploadEncoder);\n }\n texture.isReady = true;\n};\nThinWebGPUEngine.prototype.createRawCubeTextureFromUrl = function (url, scene, size, format, type, noMipmap, callback, mipmapGenerator, onLoad = null, onError = null, samplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE, invertY = false) {\n const texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode, null);\n scene?.addPendingData(texture);\n texture.url = url;\n texture.isReady = false;\n this._internalTexturesCache.push(texture);\n const onerror = (request, exception) => {\n scene?.removePendingData(texture);\n if (onError && request) {\n onError(request.status + \" \" + request.statusText, exception);\n }\n };\n const internalCallback = (data) => {\n const width = texture.width;\n const faceDataArrays = callback(data);\n if (!faceDataArrays) {\n return;\n }\n if (mipmapGenerator) {\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\n const mipData = mipmapGenerator(faceDataArrays);\n const gpuTextureWrapper = texture._hardwareTexture;\n const faces = [0, 1, 2, 3, 4, 5];\n for (let level = 0; level < mipData.length; level++) {\n const mipSize = width >> level;\n const allFaces = [];\n for (let faceIndex = 0; faceIndex < 6; faceIndex++) {\n let mipFaceData = mipData[level][faces[faceIndex]];\n if (needConversion) {\n mipFaceData = _convertRGBtoRGBATextureData(mipFaceData, mipSize, mipSize, type);\n }\n allFaces.push(new Uint8Array(mipFaceData.buffer, mipFaceData.byteOffset, mipFaceData.byteLength));\n }\n this._textureHelper.updateCubeTextures(allFaces, gpuTextureWrapper.underlyingResource, mipSize, mipSize, gpuTextureWrapper.format, invertY, false, 0, 0);\n }\n }\n else {\n this.updateRawCubeTexture(texture, faceDataArrays, format, type, invertY);\n }\n texture.isReady = true;\n scene?.removePendingData(texture);\n if (onLoad) {\n onLoad();\n }\n };\n this._loadFile(url, (data) => {\n internalCallback(data);\n }, undefined, scene?.offlineProvider, true, onerror);\n return texture;\n};\nThinWebGPUEngine.prototype.createRawTexture3D = function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression = null, textureType = Constants.TEXTURETYPE_UNSIGNED_BYTE, creationFlags = 0) {\n const source = 10 /* InternalTextureSource.Raw3D */;\n const texture = new InternalTexture(this, source);\n texture.baseWidth = width;\n texture.baseHeight = height;\n texture.baseDepth = depth;\n texture.width = width;\n texture.height = height;\n texture.depth = depth;\n texture.format = format;\n texture.type = textureType;\n texture.generateMipMaps = generateMipMaps;\n texture.samplingMode = samplingMode;\n texture.is3D = true;\n texture._creationFlags = creationFlags;\n if (!this._doNotHandleContextLost) {\n texture._bufferView = data;\n }\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, undefined, creationFlags);\n this.updateRawTexture3D(texture, data, format, invertY, compression, textureType);\n this._internalTexturesCache.push(texture);\n return texture;\n};\nThinWebGPUEngine.prototype.updateRawTexture3D = function (texture, bufferView, format, invertY, compression = null, textureType = Constants.TEXTURETYPE_UNSIGNED_BYTE) {\n if (!this._doNotHandleContextLost) {\n texture._bufferView = bufferView;\n texture.format = format;\n texture.invertY = invertY;\n texture._compression = compression;\n }\n if (bufferView) {\n const gpuTextureWrapper = texture._hardwareTexture;\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\n if (needConversion) {\n bufferView = _convertRGBtoRGBATextureData(bufferView, texture.width, texture.height, textureType);\n }\n const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\n this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);\n if (texture.generateMipMaps) {\n this._generateMipmaps(texture, this._uploadEncoder);\n }\n }\n texture.isReady = true;\n};\nThinWebGPUEngine.prototype.createRawTexture2DArray = function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression = null, textureType = Constants.TEXTURETYPE_UNSIGNED_BYTE, creationFlags = 0) {\n const source = 11 /* InternalTextureSource.Raw2DArray */;\n const texture = new InternalTexture(this, source);\n texture.baseWidth = width;\n texture.baseHeight = height;\n texture.baseDepth = depth;\n texture.width = width;\n texture.height = height;\n texture.depth = depth;\n texture.format = format;\n texture.type = textureType;\n texture.generateMipMaps = generateMipMaps;\n texture.samplingMode = samplingMode;\n texture.is2DArray = true;\n texture._creationFlags = creationFlags;\n if (!this._doNotHandleContextLost) {\n texture._bufferView = data;\n }\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, depth, creationFlags);\n this.updateRawTexture2DArray(texture, data, format, invertY, compression, textureType);\n this._internalTexturesCache.push(texture);\n return texture;\n};\nThinWebGPUEngine.prototype.updateRawTexture2DArray = function (texture, bufferView, format, invertY, compression = null, textureType = Constants.TEXTURETYPE_UNSIGNED_BYTE) {\n if (!this._doNotHandleContextLost) {\n texture._bufferView = bufferView;\n texture.format = format;\n texture.invertY = invertY;\n texture._compression = compression;\n }\n if (bufferView) {\n const gpuTextureWrapper = texture._hardwareTexture;\n const needConversion = format === Constants.TEXTUREFORMAT_RGB;\n if (needConversion) {\n bufferView = _convertRGBtoRGBATextureData(bufferView, texture.width, texture.height, textureType);\n }\n const data = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength);\n this._textureHelper.updateTexture(data, texture, texture.width, texture.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);\n if (texture.generateMipMaps) {\n this._generateMipmaps(texture, this._uploadEncoder);\n }\n }\n texture.isReady = true;\n};\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction _convertRGBtoRGBATextureData(rgbData, width, height, textureType) {\n // Create new RGBA data container.\n let rgbaData;\n let val1 = 1;\n if (textureType === Constants.TEXTURETYPE_FLOAT) {\n rgbaData = new Float32Array(width * height * 4);\n }\n else if (textureType === Constants.TEXTURETYPE_HALF_FLOAT) {\n rgbaData = new Uint16Array(width * height * 4);\n val1 = 15360; // 15360 is the encoding of 1 in half float\n }\n else if (textureType === Constants.TEXTURETYPE_UNSIGNED_INTEGER) {\n rgbaData = new Uint32Array(width * height * 4);\n }\n else {\n rgbaData = new Uint8Array(width * height * 4);\n }\n // Convert each pixel.\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n const index = (y * width + x) * 3;\n const newIndex = (y * width + x) * 4;\n // Map Old Value to new value.\n rgbaData[newIndex + 0] = rgbData[index + 0];\n rgbaData[newIndex + 1] = rgbData[index + 1];\n rgbaData[newIndex + 2] = rgbData[index + 2];\n // Add fully opaque alpha channel.\n rgbaData[newIndex + 3] = val1;\n }\n }\n return rgbaData;\n}\n//# sourceMappingURL=engine.rawTexture.js.map","import { AbstractEngine } from \"core/Engines/abstractEngine\";\nimport { Constants } from \"../../constants\";\nimport \"../../AbstractEngine/abstractEngine.alpha\";\nimport { ThinWebGPUEngine } from \"core/Engines/thinWebGPUEngine\";\nThinWebGPUEngine.prototype.setAlphaMode = function (mode, noDepthWriteChange = false) {\n if (this._alphaMode === mode && ((mode === Constants.ALPHA_DISABLE && !this._alphaState.alphaBlend) || (mode !== Constants.ALPHA_DISABLE && this._alphaState.alphaBlend))) {\n if (!noDepthWriteChange) {\n // Make sure we still have the correct depth mask according to the alpha mode (a transparent material could have forced writting to the depth buffer, for instance)\n const depthMask = mode === Constants.ALPHA_DISABLE;\n if (this.depthCullingState.depthMask !== depthMask) {\n this.setDepthWrite(depthMask);\n this._cacheRenderPipeline.setDepthWriteEnabled(depthMask);\n }\n }\n return;\n }\n switch (mode) {\n case Constants.ALPHA_DISABLE:\n this._alphaState.alphaBlend = false;\n break;\n case Constants.ALPHA_PREMULTIPLIED:\n this._alphaState.setAlphaBlendFunctionParameters(1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA, 1, 1);\n this._alphaState.alphaBlend = true;\n break;\n case Constants.ALPHA_PREMULTIPLIED_PORTERDUFF:\n this._alphaState.setAlphaBlendFunctionParameters(1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA, 1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n case Constants.ALPHA_COMBINE:\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_SRC_ALPHA, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA, 1, 1);\n this._alphaState.alphaBlend = true;\n break;\n case Constants.ALPHA_ONEONE:\n this._alphaState.setAlphaBlendFunctionParameters(1, 1, 0, 1);\n this._alphaState.alphaBlend = true;\n break;\n case Constants.ALPHA_ADD:\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_SRC_ALPHA, 1, 0, 1);\n this._alphaState.alphaBlend = true;\n break;\n case Constants.ALPHA_SUBTRACT:\n this._alphaState.setAlphaBlendFunctionParameters(0, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR, 1, 1);\n this._alphaState.alphaBlend = true;\n break;\n case Constants.ALPHA_MULTIPLY:\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_DST_COLOR, 0, 1, 1);\n this._alphaState.alphaBlend = true;\n break;\n case Constants.ALPHA_MAXIMIZED:\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_SRC_ALPHA, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR, 1, 1);\n this._alphaState.alphaBlend = true;\n break;\n case Constants.ALPHA_INTERPOLATE:\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_CONSTANT_COLOR, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_COLOR, Constants.GL_ALPHA_FUNCTION_CONSTANT_ALPHA, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n case Constants.ALPHA_SCREENMODE:\n this._alphaState.setAlphaBlendFunctionParameters(1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR, 1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n case Constants.ALPHA_ONEONE_ONEONE:\n this._alphaState.setAlphaBlendFunctionParameters(1, 1, 1, 1);\n this._alphaState.alphaBlend = true;\n break;\n case Constants.ALPHA_ALPHATOCOLOR:\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_DST_ALPHA, 1, 0, 0);\n this._alphaState.alphaBlend = true;\n break;\n case Constants.ALPHA_REVERSEONEMINUS:\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_COLOR, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_ALPHA, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n case Constants.ALPHA_SRC_DSTONEMINUSSRCALPHA:\n this._alphaState.setAlphaBlendFunctionParameters(1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA, 1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n case Constants.ALPHA_ONEONE_ONEZERO:\n this._alphaState.setAlphaBlendFunctionParameters(1, 1, 1, 0);\n this._alphaState.alphaBlend = true;\n break;\n case Constants.ALPHA_EXCLUSION:\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_COLOR, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR, 0, 1);\n this._alphaState.alphaBlend = true;\n break;\n case Constants.ALPHA_LAYER_ACCUMULATE:\n // Same as ALPHA_COMBINE but accumulates (1 - alpha) values in the alpha channel for a later readout in order independant transparency\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_SRC_ALPHA, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA, 1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n }\n if (!noDepthWriteChange) {\n this.setDepthWrite(mode === Constants.ALPHA_DISABLE);\n this._cacheRenderPipeline.setDepthWriteEnabled(mode === Constants.ALPHA_DISABLE);\n }\n this._alphaMode = mode;\n this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState.alphaBlend);\n this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters);\n};\nThinWebGPUEngine.prototype.setAlphaEquation = function (equation) {\n AbstractEngine.prototype.setAlphaEquation.call(this, equation);\n this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters);\n};\n//# sourceMappingURL=engine.alpha.js.map","import { ThinWebGPUEngine } from \"core/Engines/thinWebGPUEngine\";\nThinWebGPUEngine.prototype._readTexturePixels = function (texture, width, height, faceIndex = -1, level = 0, buffer = null, flushRenderer = true, noDataConversion = false, x = 0, y = 0) {\n const gpuTextureWrapper = texture._hardwareTexture;\n if (flushRenderer) {\n this.flushFramebuffer();\n }\n return this._textureHelper.readPixels(gpuTextureWrapper.underlyingResource, x, y, width, height, gpuTextureWrapper.format, faceIndex, level, buffer, noDataConversion);\n};\nThinWebGPUEngine.prototype._readTexturePixelsSync = function () {\n // eslint-disable-next-line no-throw-literal\n throw \"_readTexturePixelsSync is unsupported in WebGPU!\";\n};\n//# sourceMappingURL=engine.readTexture.js.map","import { InternalTexture } from \"../../../Materials/Textures/internalTexture\";\nimport { Constants } from \"../../constants\";\nimport { WebGPUTextureHelper } from \"../webgpuTextureHelper\";\nimport { ThinWebGPUEngine } from \"core/Engines/thinWebGPUEngine\";\nThinWebGPUEngine.prototype._createDepthStencilCubeTexture = function (size, options) {\n const internalTexture = new InternalTexture(this, options.generateStencil ? 12 /* InternalTextureSource.DepthStencil */ : 14 /* InternalTextureSource.Depth */);\n internalTexture.isCube = true;\n internalTexture.label = options.label;\n const internalOptions = {\n bilinearFiltering: false,\n comparisonFunction: 0,\n generateStencil: false,\n samples: 1,\n depthTextureFormat: options.generateStencil ? Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 : Constants.TEXTUREFORMAT_DEPTH32_FLOAT,\n ...options,\n };\n internalTexture.format = internalOptions.depthTextureFormat;\n this._setupDepthStencilTexture(internalTexture, size, internalOptions.bilinearFiltering, internalOptions.comparisonFunction, internalOptions.samples);\n this._textureHelper.createGPUTextureForInternalTexture(internalTexture);\n // Now that the hardware texture is created, we can retrieve the GPU format and set the right type to the internal texture\n const gpuTextureWrapper = internalTexture._hardwareTexture;\n internalTexture.type = WebGPUTextureHelper.GetTextureTypeFromFormat(gpuTextureWrapper.format);\n this._internalTexturesCache.push(internalTexture);\n return internalTexture;\n};\nThinWebGPUEngine.prototype.createCubeTexture = function (rootUrl, scene, files, noMipmap, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = false, lodScale = 0, lodOffset = 0, fallback = null, loaderOptions, useSRGBBuffer = false, buffer = null) {\n return this.createCubeTextureBase(rootUrl, scene, files, !!noMipmap, onLoad, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset, fallback, null, (texture, imgs) => {\n const imageBitmaps = imgs; // we will always get an ImageBitmap array in WebGPU\n const width = imageBitmaps[0].width;\n const height = width;\n this._setCubeMapTextureParams(texture, !noMipmap);\n texture.format = format ?? -1;\n const gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);\n this._textureHelper.updateCubeTextures(imageBitmaps, gpuTextureWrapper.underlyingResource, width, height, gpuTextureWrapper.format, false, false, 0, 0);\n if (!noMipmap) {\n this._generateMipmaps(texture, this._uploadEncoder);\n }\n texture.isReady = true;\n texture.onLoadedObservable.notifyObservers(texture);\n texture.onLoadedObservable.clear();\n if (onLoad) {\n onLoad();\n }\n }, !!useSRGBBuffer, buffer);\n};\nThinWebGPUEngine.prototype._setCubeMapTextureParams = function (texture, loadMipmap, maxLevel) {\n texture.samplingMode = loadMipmap ? Constants.TEXTURE_TRILINEAR_SAMPLINGMODE : Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\n texture._cachedWrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n texture._cachedWrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n if (maxLevel) {\n texture._maxLodLevel = maxLevel;\n }\n};\nThinWebGPUEngine.prototype.generateMipMapsForCubemap = function (texture) {\n if (texture.generateMipMaps) {\n const gpuTexture = texture._hardwareTexture?.underlyingResource;\n if (!gpuTexture) {\n this._textureHelper.createGPUTextureForInternalTexture(texture);\n }\n this._generateMipmaps(texture);\n }\n};\n//# sourceMappingURL=engine.cubeTexture.js.map","import { RenderTargetWrapper } from \"../renderTargetWrapper\";\nimport { WebGPUPerfCounter } from \"./webgpuPerfCounter\";\n/**\n * Specialized class used to store a render target of a WebGPU engine\n */\nexport class WebGPURenderTargetWrapper extends RenderTargetWrapper {\n /**\n * Initializes the render target wrapper\n * @param isMulti true if the wrapper is a multi render target\n * @param isCube true if the wrapper should render to a cube texture\n * @param size size of the render target (width/height/layers)\n * @param engine engine used to create the render target\n * @param label defines the label to use for the wrapper (for debugging purpose only)\n */\n constructor(isMulti, isCube, size, engine, label) {\n super(isMulti, isCube, size, engine, label);\n if (engine.enableGPUTimingMeasurements) {\n this.gpuTimeInFrame = new WebGPUPerfCounter();\n }\n }\n}\n//# sourceMappingURL=webgpuRenderTargetWrapper.js.map","import { GetTypeForDepthTexture, InternalTexture } from \"../../../Materials/Textures/internalTexture\";\nimport { Constants } from \"../../constants\";\nimport { WebGPURenderTargetWrapper } from \"../webgpuRenderTargetWrapper\";\nimport \"../../AbstractEngine/abstractEngine.texture\";\nimport { ThinWebGPUEngine } from \"core/Engines/thinWebGPUEngine\";\nThinWebGPUEngine.prototype._createHardwareRenderTargetWrapper = function (isMulti, isCube, size) {\n const rtWrapper = new WebGPURenderTargetWrapper(isMulti, isCube, size, this);\n this._renderTargetWrapperCache.push(rtWrapper);\n return rtWrapper;\n};\nThinWebGPUEngine.prototype.createRenderTargetTexture = function (size, options) {\n const rtWrapper = this._createHardwareRenderTargetWrapper(false, false, size);\n const fullOptions = {};\n if (options !== undefined && typeof options === \"object\") {\n fullOptions.generateMipMaps = options.generateMipMaps;\n fullOptions.generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;\n fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer;\n fullOptions.samplingMode = options.samplingMode === undefined ? Constants.TEXTURE_TRILINEAR_SAMPLINGMODE : options.samplingMode;\n fullOptions.creationFlags = options.creationFlags ?? 0;\n fullOptions.noColorAttachment = !!options.noColorAttachment;\n fullOptions.colorAttachment = options.colorAttachment;\n fullOptions.samples = options.samples;\n fullOptions.label = options.label;\n fullOptions.format = options.format;\n fullOptions.type = options.type;\n }\n else {\n fullOptions.generateMipMaps = options;\n fullOptions.generateDepthBuffer = true;\n fullOptions.generateStencilBuffer = false;\n fullOptions.samplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE;\n fullOptions.creationFlags = 0;\n fullOptions.noColorAttachment = false;\n }\n const texture = fullOptions.colorAttachment || (fullOptions.noColorAttachment ? null : this._createInternalTexture(size, fullOptions, true, 5 /* InternalTextureSource.RenderTarget */));\n rtWrapper.label = fullOptions.label ?? \"RenderTargetWrapper\";\n rtWrapper._samples = fullOptions.colorAttachment?.samples ?? fullOptions.samples ?? 1;\n rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer;\n rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer ? true : false;\n rtWrapper.setTextures(texture);\n if (rtWrapper._generateDepthBuffer || rtWrapper._generateStencilBuffer) {\n rtWrapper.createDepthStencilTexture(0, false, // force false as filtering is not supported for depth textures\n rtWrapper._generateStencilBuffer, rtWrapper.samples, fullOptions.generateStencilBuffer ? Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 : Constants.TEXTUREFORMAT_DEPTH32_FLOAT, fullOptions.label ? fullOptions.label + \"-DepthStencil\" : undefined);\n }\n if (texture && !fullOptions.colorAttachment) {\n if (options !== undefined && typeof options === \"object\" && options.createMipMaps && !fullOptions.generateMipMaps) {\n texture.generateMipMaps = true;\n }\n this._textureHelper.createGPUTextureForInternalTexture(texture, undefined, undefined, undefined, fullOptions.creationFlags);\n if (options !== undefined && typeof options === \"object\" && options.createMipMaps && !fullOptions.generateMipMaps) {\n texture.generateMipMaps = false;\n }\n }\n return rtWrapper;\n};\nThinWebGPUEngine.prototype._createDepthStencilTexture = function (size, options, wrapper) {\n const internalOptions = {\n bilinearFiltering: false,\n comparisonFunction: 0,\n generateStencil: false,\n samples: 1,\n depthTextureFormat: options.generateStencil ? Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 : Constants.TEXTUREFORMAT_DEPTH32_FLOAT,\n ...options,\n };\n const hasStencil = internalOptions.depthTextureFormat === Constants.TEXTUREFORMAT_DEPTH24UNORM_STENCIL8 ||\n internalOptions.depthTextureFormat === Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 ||\n internalOptions.depthTextureFormat === Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8;\n wrapper._depthStencilTextureWithStencil = hasStencil;\n const internalTexture = new InternalTexture(this, hasStencil ? 12 /* InternalTextureSource.DepthStencil */ : 14 /* InternalTextureSource.Depth */);\n internalTexture.label = options.label;\n internalTexture.format = internalOptions.depthTextureFormat;\n internalTexture.type = GetTypeForDepthTexture(internalTexture.format);\n this._setupDepthStencilTexture(internalTexture, size, internalOptions.bilinearFiltering, internalOptions.comparisonFunction, internalOptions.samples);\n this._textureHelper.createGPUTextureForInternalTexture(internalTexture);\n this._internalTexturesCache.push(internalTexture);\n return internalTexture;\n};\nThinWebGPUEngine.prototype._setupDepthStencilTexture = function (internalTexture, size, bilinearFiltering, comparisonFunction, samples = 1) {\n const width = size.width ?? size;\n const height = size.height ?? size;\n const layers = size.layers || 0;\n const depth = size.depth || 0;\n internalTexture.baseWidth = width;\n internalTexture.baseHeight = height;\n internalTexture.width = width;\n internalTexture.height = height;\n internalTexture.is2DArray = layers > 0;\n internalTexture.is3D = depth > 0;\n internalTexture.depth = layers || depth;\n internalTexture.isReady = true;\n internalTexture.samples = samples;\n internalTexture.generateMipMaps = false;\n internalTexture.samplingMode = bilinearFiltering ? Constants.TEXTURE_BILINEAR_SAMPLINGMODE : Constants.TEXTURE_NEAREST_SAMPLINGMODE;\n internalTexture.type = Constants.TEXTURETYPE_FLOAT; // the right type will be set later\n internalTexture._comparisonFunction = comparisonFunction;\n internalTexture._cachedWrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n internalTexture._cachedWrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n};\nThinWebGPUEngine.prototype.updateRenderTargetTextureSampleCount = function (rtWrapper, samples) {\n if (!rtWrapper || !rtWrapper.texture || rtWrapper.samples === samples) {\n return samples;\n }\n samples = Math.min(samples, this.getCaps().maxMSAASamples);\n this._textureHelper.createMSAATexture(rtWrapper.texture, samples);\n if (rtWrapper._depthStencilTexture) {\n this._textureHelper.createMSAATexture(rtWrapper._depthStencilTexture, samples);\n rtWrapper._depthStencilTexture.samples = samples;\n }\n rtWrapper._samples = samples;\n rtWrapper.texture.samples = samples;\n return samples;\n};\n//# sourceMappingURL=engine.renderTarget.js.map","import { ThinWebGPUEngine } from \"core/Engines/thinWebGPUEngine\";\nThinWebGPUEngine.prototype.setDepthStencilTexture = function (channel, uniform, texture, name) {\n if (!texture || !texture.depthStencilTexture) {\n this._setTexture(channel, null, undefined, undefined, name);\n }\n else {\n this._setTexture(channel, texture, false, true, name);\n }\n};\n//# sourceMappingURL=engine.renderTargetTexture.js.map","import { ThinWebGPUEngine } from \"core/Engines/thinWebGPUEngine\";\nimport { InternalTexture } from \"../../../Materials/Textures/internalTexture\";\nimport { Constants } from \"../../constants\";\nThinWebGPUEngine.prototype.createRenderTargetCubeTexture = function (size, options) {\n const rtWrapper = this._createHardwareRenderTargetWrapper(false, true, size);\n const fullOptions = {\n generateMipMaps: true,\n generateDepthBuffer: true,\n generateStencilBuffer: false,\n type: Constants.TEXTURETYPE_UNSIGNED_BYTE,\n samplingMode: Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\n format: Constants.TEXTUREFORMAT_RGBA,\n samples: 1,\n ...options,\n };\n fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer;\n rtWrapper.label = fullOptions.label ?? \"RenderTargetWrapper\";\n rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer;\n rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer;\n const texture = new InternalTexture(this, 5 /* InternalTextureSource.RenderTarget */);\n texture.width = size;\n texture.height = size;\n texture.depth = 0;\n texture.isReady = true;\n texture.isCube = true;\n texture.samples = fullOptions.samples;\n texture.generateMipMaps = fullOptions.generateMipMaps;\n texture.samplingMode = fullOptions.samplingMode;\n texture.type = fullOptions.type;\n texture.format = fullOptions.format;\n this._internalTexturesCache.push(texture);\n rtWrapper.setTextures(texture);\n if (rtWrapper._generateDepthBuffer || rtWrapper._generateStencilBuffer) {\n rtWrapper.createDepthStencilTexture(0, fullOptions.samplingMode === undefined ||\n fullOptions.samplingMode === Constants.TEXTURE_BILINEAR_SAMPLINGMODE ||\n fullOptions.samplingMode === Constants.TEXTURE_LINEAR_LINEAR ||\n fullOptions.samplingMode === Constants.TEXTURE_TRILINEAR_SAMPLINGMODE ||\n fullOptions.samplingMode === Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR ||\n fullOptions.samplingMode === Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST ||\n fullOptions.samplingMode === Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR ||\n fullOptions.samplingMode === Constants.TEXTURE_NEAREST_LINEAR ||\n fullOptions.samplingMode === Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST, rtWrapper._generateStencilBuffer, rtWrapper.samples);\n }\n if (options && options.createMipMaps && !fullOptions.generateMipMaps) {\n texture.generateMipMaps = true;\n }\n this._textureHelper.createGPUTextureForInternalTexture(texture);\n if (options && options.createMipMaps && !fullOptions.generateMipMaps) {\n texture.generateMipMaps = false;\n }\n return rtWrapper;\n};\n//# sourceMappingURL=engine.renderTargetCube.js.map","import { AbstractMesh } from \"core/Meshes/abstractMesh\";\nimport { AbstractEngine } from \"../abstractEngine\";\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class _OcclusionDataStorage {\n constructor() {\n /** @internal */\n this.occlusionInternalRetryCounter = 0;\n /** @internal */\n this.isOcclusionQueryInProgress = false;\n /** @internal */\n this.isOccluded = false;\n /** @internal */\n this.occlusionRetryCount = -1;\n /** @internal */\n this.occlusionType = AbstractMesh.OCCLUSION_TYPE_NONE;\n /** @internal */\n this.occlusionQueryAlgorithmType = AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE;\n /** @internal */\n this.forceRenderingWhenOccluded = false;\n }\n}\nAbstractEngine.prototype.getGPUFrameTimeCounter = function () {\n return null;\n};\nAbstractEngine.prototype.captureGPUFrameTime = function (value) {\n // Do nothing. Must be implemented by child classes\n};\nAbstractEngine.prototype.createQuery = function () {\n return null;\n};\nAbstractEngine.prototype.deleteQuery = function (query) {\n // Do nothing. Must be implemented by child classes\n return this;\n};\nAbstractEngine.prototype.isQueryResultAvailable = function (query) {\n // Do nothing. Must be implemented by child classes\n return false;\n};\nAbstractEngine.prototype.getQueryResult = function (query) {\n // Do nothing. Must be implemented by child classes\n return 0;\n};\nAbstractEngine.prototype.beginOcclusionQuery = function (algorithmType, query) {\n // Do nothing. Must be implemented by child classes\n return false;\n};\nAbstractEngine.prototype.endOcclusionQuery = function (algorithmType) {\n // Do nothing. Must be implemented by child classes\n return this;\n};\nObject.defineProperty(AbstractMesh.prototype, \"isOcclusionQueryInProgress\", {\n get: function () {\n return this._occlusionDataStorage.isOcclusionQueryInProgress;\n },\n set: function (value) {\n this._occlusionDataStorage.isOcclusionQueryInProgress = value;\n },\n enumerable: false,\n configurable: true,\n});\nObject.defineProperty(AbstractMesh.prototype, \"_occlusionDataStorage\", {\n get: function () {\n if (!this.__occlusionDataStorage) {\n this.__occlusionDataStorage = new _OcclusionDataStorage();\n }\n return this.__occlusionDataStorage;\n },\n enumerable: false,\n configurable: true,\n});\nObject.defineProperty(AbstractMesh.prototype, \"isOccluded\", {\n get: function () {\n return this._occlusionDataStorage.isOccluded;\n },\n set: function (value) {\n this._occlusionDataStorage.isOccluded = value;\n },\n enumerable: true,\n configurable: true,\n});\nObject.defineProperty(AbstractMesh.prototype, \"occlusionQueryAlgorithmType\", {\n get: function () {\n return this._occlusionDataStorage.occlusionQueryAlgorithmType;\n },\n set: function (value) {\n this._occlusionDataStorage.occlusionQueryAlgorithmType = value;\n },\n enumerable: true,\n configurable: true,\n});\nObject.defineProperty(AbstractMesh.prototype, \"occlusionType\", {\n get: function () {\n return this._occlusionDataStorage.occlusionType;\n },\n set: function (value) {\n this._occlusionDataStorage.occlusionType = value;\n },\n enumerable: true,\n configurable: true,\n});\nObject.defineProperty(AbstractMesh.prototype, \"occlusionRetryCount\", {\n get: function () {\n return this._occlusionDataStorage.occlusionRetryCount;\n },\n set: function (value) {\n this._occlusionDataStorage.occlusionRetryCount = value;\n },\n enumerable: true,\n configurable: true,\n});\nObject.defineProperty(AbstractMesh.prototype, \"forceRenderingWhenOccluded\", {\n get: function () {\n return this._occlusionDataStorage.forceRenderingWhenOccluded;\n },\n set: function (value) {\n this._occlusionDataStorage.forceRenderingWhenOccluded = value;\n },\n enumerable: true,\n configurable: true,\n});\n// We also need to update AbstractMesh as there is a portion of the code there\nAbstractMesh.prototype._checkOcclusionQuery = function () {\n const dataStorage = this._occlusionDataStorage;\n if (dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_NONE) {\n dataStorage.isOccluded = false;\n return false;\n }\n const engine = this.getEngine();\n if (!engine.getCaps().supportOcclusionQuery) {\n dataStorage.isOccluded = false;\n return false;\n }\n if (!engine.isQueryResultAvailable) {\n // Occlusion query where not referenced\n dataStorage.isOccluded = false;\n return false;\n }\n if (this.isOcclusionQueryInProgress && this._occlusionQuery !== null && this._occlusionQuery !== undefined) {\n const isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);\n if (isOcclusionQueryAvailable) {\n const occlusionQueryResult = engine.getQueryResult(this._occlusionQuery);\n dataStorage.isOcclusionQueryInProgress = false;\n dataStorage.occlusionInternalRetryCounter = 0;\n dataStorage.isOccluded = occlusionQueryResult > 0 ? false : true;\n }\n else {\n dataStorage.occlusionInternalRetryCounter++;\n if (dataStorage.occlusionRetryCount !== -1 && dataStorage.occlusionInternalRetryCounter > dataStorage.occlusionRetryCount) {\n dataStorage.isOcclusionQueryInProgress = false;\n dataStorage.occlusionInternalRetryCounter = 0;\n // if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)\n // if strict continue the last state of the object.\n dataStorage.isOccluded = dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;\n }\n else {\n return dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;\n }\n }\n }\n const scene = this.getScene();\n if (scene.getBoundingBoxRenderer) {\n const occlusionBoundingBoxRenderer = scene.getBoundingBoxRenderer();\n if (this._occlusionQuery === null) {\n this._occlusionQuery = engine.createQuery();\n }\n if (this._occlusionQuery && engine.beginOcclusionQuery(dataStorage.occlusionQueryAlgorithmType, this._occlusionQuery)) {\n occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);\n engine.endOcclusionQuery(dataStorage.occlusionQueryAlgorithmType);\n this._occlusionDataStorage.isOcclusionQueryInProgress = true;\n }\n }\n return dataStorage.isOccluded;\n};\n//# sourceMappingURL=abstractEngine.query.js.map","import { ThinWebGPUEngine } from \"core/Engines/thinWebGPUEngine\";\nimport { WebGPURenderItemBeginOcclusionQuery, WebGPURenderItemEndOcclusionQuery } from \"../webgpuBundleList\";\nimport \"../../../Engines/AbstractEngine/abstractEngine.query\";\nThinWebGPUEngine.prototype.getGPUFrameTimeCounter = function () {\n return this._timestampQuery.gpuFrameTimeCounter;\n};\nThinWebGPUEngine.prototype.captureGPUFrameTime = function (value) {\n this._timestampQuery.enable = value && !!this._caps.timerQuery;\n};\nThinWebGPUEngine.prototype.createQuery = function () {\n return this._occlusionQuery.createQuery();\n};\nThinWebGPUEngine.prototype.deleteQuery = function (query) {\n this._occlusionQuery.deleteQuery(query);\n return this;\n};\nThinWebGPUEngine.prototype.isQueryResultAvailable = function (query) {\n return this._occlusionQuery.isQueryResultAvailable(query);\n};\nThinWebGPUEngine.prototype.getQueryResult = function (query) {\n return this._occlusionQuery.getQueryResult(query);\n};\nThinWebGPUEngine.prototype.beginOcclusionQuery = function (algorithmType, query) {\n if (this.compatibilityMode) {\n if (this._occlusionQuery.canBeginQuery(query)) {\n this._currentRenderPass?.beginOcclusionQuery(query);\n return true;\n }\n }\n else {\n this._bundleList.addItem(new WebGPURenderItemBeginOcclusionQuery(query));\n return true;\n }\n return false;\n};\nThinWebGPUEngine.prototype.endOcclusionQuery = function () {\n if (this.compatibilityMode) {\n this._currentRenderPass?.endOcclusionQuery();\n }\n else {\n this._bundleList.addItem(new WebGPURenderItemEndOcclusionQuery());\n }\n return this;\n};\n//# sourceMappingURL=engine.query.js.map","/* eslint-disable babylonjs/available */\nimport { Logger } from \"../Misc/logger\";\nimport { ThinWebGPUEngine } from \"./thinWebGPUEngine\";\nimport { Color4 } from \"../Maths/math\";\nimport { InternalTexture } from \"../Materials/Textures/internalTexture\";\nimport { Effect } from \"../Materials/effect\";\nimport { Constants } from \"./constants\";\n// eslint-disable-next-line @typescript-eslint/naming-convention\nimport * as WebGPUConstants from \"./WebGPU/webgpuConstants\";\nimport { VertexBuffer } from \"../Buffers/buffer\";\nimport { WebGPUPipelineContext } from \"./WebGPU/webgpuPipelineContext\";\nimport { WebGPUShaderProcessorGLSL } from \"./WebGPU/webgpuShaderProcessorsGLSL\";\nimport { WebGPUShaderProcessorWGSL } from \"./WebGPU/webgpuShaderProcessorsWGSL\";\nimport { WebGPUShaderProcessingContext } from \"./WebGPU/webgpuShaderProcessingContext\";\nimport { Tools } from \"../Misc/tools\";\nimport { WebGPUTextureHelper } from \"./WebGPU/webgpuTextureHelper\";\nimport { WebGPUTextureManager } from \"./WebGPU/webgpuTextureManager\";\nimport { AbstractEngine } from \"./abstractEngine\";\nimport { WebGPUBufferManager } from \"./WebGPU/webgpuBufferManager\";\nimport { WebGPUHardwareTexture } from \"./WebGPU/webgpuHardwareTexture\";\nimport { UniformBuffer } from \"../Materials/uniformBuffer\";\nimport { WebGPUCacheSampler } from \"./WebGPU/webgpuCacheSampler\";\nimport { WebGPUCacheRenderPipelineTree } from \"./WebGPU/webgpuCacheRenderPipelineTree\";\nimport { WebGPUStencilStateComposer } from \"./WebGPU/webgpuStencilStateComposer\";\nimport { WebGPUDepthCullingState } from \"./WebGPU/webgpuDepthCullingState\";\nimport { WebGPUMaterialContext } from \"./WebGPU/webgpuMaterialContext\";\nimport { WebGPUDrawContext } from \"./WebGPU/webgpuDrawContext\";\nimport { WebGPUCacheBindGroups } from \"./WebGPU/webgpuCacheBindGroups\";\nimport { WebGPUClearQuad } from \"./WebGPU/webgpuClearQuad\";\nimport { WebGPURenderItemBlendColor, WebGPURenderItemScissor, WebGPURenderItemStencilRef, WebGPURenderItemViewport, WebGPUBundleList } from \"./WebGPU/webgpuBundleList\";\nimport { WebGPUTimestampQuery } from \"./WebGPU/webgpuTimestampQuery\";\nimport { WebGPUOcclusionQuery } from \"./WebGPU/webgpuOcclusionQuery\";\nimport { ShaderCodeInliner } from \"./Processors/shaderCodeInliner\";\nimport { WebGPUTintWASM } from \"./WebGPU/webgpuTintWASM\";\nimport { WebGPUShaderProcessor } from \"./WebGPU/webgpuShaderProcessor\";\nimport { WebGPUSnapshotRendering } from \"./WebGPU/webgpuSnapshotRendering\";\nimport \"../Buffers/buffer.align\";\nimport { SphericalPolynomial } from \"../Maths/sphericalPolynomial\";\nimport { PerformanceMonitor } from \"../Misc/performanceMonitor\";\nimport { CreateImageBitmapFromSource, ExitFullscreen, ExitPointerlock, GetFontOffset, RequestFullscreen, RequestPointerlock, ResizeImageBitmap, _CommonDispose, _CommonInit, } from \"./engine.common\";\nimport { IsWrapper } from \"../Materials/drawWrapper.functions\";\nimport { PerfCounter } from \"../Misc/perfCounter\";\nimport \"./AbstractEngine/abstractEngine.loadingScreen\";\nimport \"./AbstractEngine/abstractEngine.dom\";\nimport \"./AbstractEngine/abstractEngine.states\";\nimport \"./AbstractEngine/abstractEngine.renderPass\";\nimport \"../Audio/audioEngine\";\nimport { resetCachedPipeline } from \"../Materials/effect.functions\";\nimport { WebGPUExternalTexture } from \"./WebGPU/webgpuExternalTexture\";\nimport \"./WebGPU/Extensions/engine.alpha\";\nimport \"./WebGPU/Extensions/engine.rawTexture\";\nimport \"./WebGPU/Extensions/engine.readTexture\";\nimport \"./WebGPU/Extensions/engine.cubeTexture\";\nimport \"./WebGPU/Extensions/engine.renderTarget\";\nimport \"./WebGPU/Extensions/engine.renderTargetTexture\";\nimport \"./WebGPU/Extensions/engine.renderTargetCube\";\nimport \"./WebGPU/Extensions/engine.query\";\nconst viewDescriptorSwapChainAntialiasing = {\n label: `TextureView_SwapChain_ResolveTarget`,\n dimension: \"2d\" /* WebGPUConstants.TextureDimension.E2d */,\n format: undefined, // will be updated with the right value\n mipLevelCount: 1,\n arrayLayerCount: 1,\n};\nconst viewDescriptorSwapChain = {\n label: `TextureView_SwapChain`,\n dimension: \"2d\" /* WebGPUConstants.TextureDimension.E2d */,\n format: undefined, // will be updated with the right value\n mipLevelCount: 1,\n arrayLayerCount: 1,\n};\nconst tempColor4 = new Color4();\n/**\n * The web GPU engine class provides support for WebGPU version of babylon.js.\n * @since 5.0.0\n */\nexport class WebGPUEngine extends ThinWebGPUEngine {\n /**\n * Gets or sets the snapshot rendering mode\n */\n get snapshotRenderingMode() {\n return this._snapshotRendering.mode;\n }\n set snapshotRenderingMode(mode) {\n this._snapshotRendering.mode = mode;\n }\n /**\n * Creates a new snapshot at the next frame using the current snapshotRenderingMode\n */\n snapshotRenderingReset() {\n this._snapshotRendering.reset();\n }\n /**\n * Enables or disables the snapshot rendering mode\n * Note that the WebGL engine does not support snapshot rendering so setting the value won't have any effect for this engine\n */\n get snapshotRendering() {\n return this._snapshotRendering.enabled;\n }\n set snapshotRendering(activate) {\n this._snapshotRendering.enabled = activate;\n }\n /**\n * Sets this to true to disable the cache for the samplers. You should do it only for testing purpose!\n */\n get disableCacheSamplers() {\n return this._cacheSampler ? this._cacheSampler.disabled : false;\n }\n set disableCacheSamplers(disable) {\n if (this._cacheSampler) {\n this._cacheSampler.disabled = disable;\n }\n }\n /**\n * Sets this to true to disable the cache for the render pipelines. You should do it only for testing purpose!\n */\n get disableCacheRenderPipelines() {\n return this._cacheRenderPipeline ? this._cacheRenderPipeline.disabled : false;\n }\n set disableCacheRenderPipelines(disable) {\n if (this._cacheRenderPipeline) {\n this._cacheRenderPipeline.disabled = disable;\n }\n }\n /**\n * Sets this to true to disable the cache for the bind groups. You should do it only for testing purpose!\n */\n get disableCacheBindGroups() {\n return this._cacheBindGroups ? this._cacheBindGroups.disabled : false;\n }\n set disableCacheBindGroups(disable) {\n if (this._cacheBindGroups) {\n this._cacheBindGroups.disabled = disable;\n }\n }\n /**\n * Gets a boolean indicating if all created effects are ready\n * @returns true if all effects are ready\n */\n areAllEffectsReady() {\n return true;\n }\n /**\n * Get Font size information\n * @param font font name\n * @returns an object containing ascent, height and descent\n */\n getFontOffset(font) {\n return GetFontOffset(font);\n }\n /**\n * Gets a Promise<boolean> indicating if the engine can be instantiated (ie. if a WebGPU context can be found)\n */\n static get IsSupportedAsync() {\n return !navigator.gpu\n ? Promise.resolve(false)\n : navigator.gpu\n .requestAdapter()\n .then((adapter) => !!adapter, () => false)\n .catch(() => false);\n }\n /**\n * Not supported by WebGPU, you should call IsSupportedAsync instead!\n */\n static get IsSupported() {\n Logger.Warn(\"You must call IsSupportedAsync for WebGPU!\");\n return false;\n }\n /**\n * Gets a boolean indicating that the engine supports uniform buffers\n */\n get supportsUniformBuffers() {\n return true;\n }\n /** Gets the supported extensions by the WebGPU adapter */\n get supportedExtensions() {\n return this._adapterSupportedExtensions;\n }\n /** Gets the currently enabled extensions on the WebGPU device */\n get enabledExtensions() {\n return this._deviceEnabledExtensions;\n }\n /** Gets the supported limits by the WebGPU adapter */\n get supportedLimits() {\n return this._adapterSupportedLimits;\n }\n /** Gets the current limits of the WebGPU device */\n get currentLimits() {\n return this._deviceLimits;\n }\n /**\n * Returns a string describing the current engine\n */\n get description() {\n const description = this.name + this.version;\n return description;\n }\n /**\n * Returns the version of the engine\n */\n get version() {\n return 1;\n }\n /**\n * Gets an object containing information about the current engine context\n * @returns an object containing the vendor, the renderer and the version of the current engine context\n */\n getInfo() {\n return {\n vendor: this._adapterInfo.vendor || \"unknown vendor\",\n renderer: this._adapterInfo.architecture || \"unknown renderer\",\n version: this._adapterInfo.description || \"unknown version\",\n };\n }\n /**\n * (WebGPU only) True (default) to be in compatibility mode, meaning rendering all existing scenes without artifacts (same rendering than WebGL).\n * Setting the property to false will improve performances but may not work in some scenes if some precautions are not taken.\n * See https://doc.babylonjs.com/setup/support/webGPU/webGPUOptimization/webGPUNonCompatibilityMode for more details\n */\n get compatibilityMode() {\n return this._compatibilityMode;\n }\n set compatibilityMode(mode) {\n this._compatibilityMode = mode;\n }\n /** @internal */\n get currentSampleCount() {\n return this._currentRenderTarget ? this._currentRenderTarget.samples : this._mainPassSampleCount;\n }\n /**\n * Create a new instance of the gpu engine asynchronously\n * @param canvas Defines the canvas to use to display the result\n * @param options Defines the options passed to the engine to create the GPU context dependencies\n * @returns a promise that resolves with the created engine\n */\n static CreateAsync(canvas, options = {}) {\n const engine = new WebGPUEngine(canvas, options);\n return new Promise((resolve) => {\n engine.initAsync(options.glslangOptions, options.twgslOptions).then(() => resolve(engine));\n });\n }\n /**\n * Create a new instance of the gpu engine.\n * @param canvas Defines the canvas to use to display the result\n * @param options Defines the options passed to the engine to create the GPU context dependencies\n */\n constructor(canvas, options = {}) {\n super(options.antialias ?? true, options);\n /** A unique id to identify this instance */\n this.uniqueId = -1;\n // Page Life cycle and constants\n this._uploadEncoderDescriptor = { label: \"upload\" };\n this._renderEncoderDescriptor = { label: \"render\" };\n /** @internal */\n this._clearDepthValue = 1;\n /** @internal */\n this._clearReverseDepthValue = 0;\n /** @internal */\n this._clearStencilValue = 0;\n this._defaultSampleCount = 4; // Only supported value for now.\n this._glslang = null;\n this._tintWASM = null;\n this._glslangAndTintAreFullyLoaded = false;\n this._adapterInfo = {\n vendor: \"\",\n architecture: \"\",\n device: \"\",\n description: \"\",\n };\n /** @internal */\n this._compiledComputeEffects = {};\n /** @internal */\n this._counters = {\n numEnableEffects: 0,\n numEnableDrawWrapper: 0,\n numBundleCreationNonCompatMode: 0,\n numBundleReuseNonCompatMode: 0,\n };\n /**\n * Counters from last frame\n */\n this.countersLastFrame = {\n numEnableEffects: 0,\n numEnableDrawWrapper: 0,\n numBundleCreationNonCompatMode: 0,\n numBundleReuseNonCompatMode: 0,\n };\n /**\n * Max number of uncaptured error messages to log\n */\n this.numMaxUncapturedErrors = 20;\n /**\n * Gets the list of created scenes\n */\n this.scenes = [];\n /** @internal */\n this._virtualScenes = new Array();\n this._commandBuffers = [null, null];\n // Frame Buffer Life Cycle (recreated for each render target pass)\n this._mainRenderPassWrapper = {\n renderPassDescriptor: null,\n colorAttachmentViewDescriptor: null,\n depthAttachmentViewDescriptor: null,\n colorAttachmentGPUTextures: [],\n depthTextureFormat: undefined,\n };\n this._rttRenderPassWrapper = {\n renderPassDescriptor: null,\n colorAttachmentViewDescriptor: null,\n depthAttachmentViewDescriptor: null,\n colorAttachmentGPUTextures: [],\n depthTextureFormat: undefined,\n };\n /** @internal */\n this._pendingDebugCommands = [];\n this._currentOverrideVertexBuffers = null;\n this._currentIndexBuffer = null;\n this._colorWriteLocal = true;\n this._forceEnableEffect = false;\n /**\n * Indicates if the z range in NDC space is 0..1 (value: true) or -1..1 (value: false)\n */\n this.isNDCHalfZRange = true;\n /**\n * Indicates that the origin of the texture/framebuffer space is the bottom left corner. If false, the origin is top left\n */\n this.hasOriginBottomLeft = false;\n //------------------------------------------------------------------------------\n // Initialization\n //------------------------------------------------------------------------------\n this._workingGlslangAndTintPromise = null;\n //------------------------------------------------------------------------------\n // Dynamic WebGPU States\n //------------------------------------------------------------------------------\n // index 0 is for main render pass, 1 for RTT render pass\n this._viewportsCurrent = { x: 0, y: 0, w: 0, h: 0 };\n this._scissorsCurrent = { x: 0, y: 0, w: 0, h: 0 };\n this._scissorCached = { x: 0, y: 0, z: 0, w: 0 };\n this._stencilRefsCurrent = -1;\n this._blendColorsCurrent = [null, null, null, null];\n this._performanceMonitor = new PerformanceMonitor();\n this._name = \"WebGPU\";\n this._drawCalls = new PerfCounter();\n options.deviceDescriptor = options.deviceDescriptor || {};\n options.enableGPUDebugMarkers = options.enableGPUDebugMarkers ?? false;\n Logger.Log(`Babylon.js v${AbstractEngine.Version} - ${this.description} engine`);\n if (!navigator.gpu) {\n Logger.Error(\"WebGPU is not supported by your browser.\");\n return;\n }\n options.swapChainFormat = options.swapChainFormat || navigator.gpu.getPreferredCanvasFormat();\n this._isWebGPU = true;\n this._shaderPlatformName = \"WEBGPU\";\n this._renderingCanvas = canvas;\n this._options = options;\n this._mainPassSampleCount = options.antialias ? this._defaultSampleCount : 1;\n if (navigator && navigator.userAgent) {\n this._setupMobileChecks();\n }\n this._sharedInit(this._renderingCanvas);\n this._shaderProcessor = new WebGPUShaderProcessorGLSL();\n this._shaderProcessorWGSL = new WebGPUShaderProcessorWGSL();\n }\n /**\n * Load the glslang and tintWASM libraries and prepare them for use.\n * @returns a promise that resolves when the engine is ready to use the glslang and tintWASM\n */\n prepareGlslangAndTintAsync() {\n if (!this._workingGlslangAndTintPromise) {\n this._workingGlslangAndTintPromise = new Promise((resolve) => {\n this._initGlslang(this._glslangOptions ?? this._options?.glslangOptions).then((glslang) => {\n this._glslang = glslang;\n this._tintWASM = new WebGPUTintWASM();\n this._tintWASM.initTwgsl(this._twgslOptions ?? this._options?.twgslOptions).then(() => {\n this._glslangAndTintAreFullyLoaded = true;\n resolve();\n });\n });\n });\n }\n return this._workingGlslangAndTintPromise;\n }\n /**\n * Initializes the WebGPU context and dependencies.\n * @param glslangOptions Defines the GLSLang compiler options if necessary\n * @param twgslOptions Defines the Twgsl compiler options if necessary\n * @returns a promise notifying the readiness of the engine.\n */\n initAsync(glslangOptions, twgslOptions) {\n this.uniqueId = WebGPUEngine._InstanceId++;\n this._glslangOptions = glslangOptions;\n this._twgslOptions = twgslOptions;\n return navigator\n .gpu.requestAdapter(this._options)\n .then((adapter) => {\n if (!adapter) {\n // eslint-disable-next-line no-throw-literal\n throw \"Could not retrieve a WebGPU adapter (adapter is null).\";\n }\n else {\n this._adapter = adapter;\n this._adapterSupportedExtensions = [];\n this._adapter.features?.forEach((feature) => this._adapterSupportedExtensions.push(feature));\n this._adapterSupportedLimits = this._adapter.limits;\n this._adapterInfo = this._adapter.info;\n const deviceDescriptor = this._options.deviceDescriptor ?? {};\n const requiredFeatures = deviceDescriptor?.requiredFeatures ?? (this._options.enableAllFeatures ? this._adapterSupportedExtensions : undefined);\n if (requiredFeatures) {\n const requestedExtensions = requiredFeatures;\n const validExtensions = [];\n for (const extension of requestedExtensions) {\n if (this._adapterSupportedExtensions.indexOf(extension) !== -1) {\n validExtensions.push(extension);\n }\n }\n deviceDescriptor.requiredFeatures = validExtensions;\n }\n if (this._options.setMaximumLimits && !deviceDescriptor.requiredLimits) {\n deviceDescriptor.requiredLimits = {};\n for (const name in this._adapterSupportedLimits) {\n if (name === \"minSubgroupSize\" || name === \"maxSubgroupSize\") {\n // Chrome exposes these limits in \"webgpu developer\" mode, but these can't be set on the device.\n continue;\n }\n deviceDescriptor.requiredLimits[name] = this._adapterSupportedLimits[name];\n }\n }\n deviceDescriptor.label = `BabylonWebGPUDevice${this.uniqueId}`;\n return this._adapter.requestDevice(deviceDescriptor);\n }\n })\n .then((device) => {\n this._device = device;\n this._deviceEnabledExtensions = [];\n this._device.features?.forEach((feature) => this._deviceEnabledExtensions.push(feature));\n this._deviceLimits = device.limits;\n let numUncapturedErrors = -1;\n this._device.addEventListener(\"uncapturederror\", (event) => {\n if (++numUncapturedErrors < this.numMaxUncapturedErrors) {\n Logger.Warn(`WebGPU uncaptured error (${numUncapturedErrors + 1}): ${event.error} - ${event.error.message}`);\n }\n else if (numUncapturedErrors++ === this.numMaxUncapturedErrors) {\n Logger.Warn(`WebGPU uncaptured error: too many warnings (${this.numMaxUncapturedErrors}), no more warnings will be reported to the console for this engine.`);\n }\n });\n if (!this._doNotHandleContextLost) {\n this._device.lost?.then((info) => {\n if (this._isDisposed) {\n return;\n }\n this._contextWasLost = true;\n Logger.Warn(\"WebGPU context lost. \" + info);\n this.onContextLostObservable.notifyObservers(this);\n this._restoreEngineAfterContextLost(async () => {\n const snapshotRenderingMode = this.snapshotRenderingMode;\n const snapshotRendering = this.snapshotRendering;\n const disableCacheSamplers = this.disableCacheSamplers;\n const disableCacheRenderPipelines = this.disableCacheRenderPipelines;\n const disableCacheBindGroups = this.disableCacheBindGroups;\n const enableGPUTimingMeasurements = this.enableGPUTimingMeasurements;\n await this.initAsync(this._glslangOptions ?? this._options?.glslangOptions, this._twgslOptions ?? this._options?.twgslOptions);\n this.snapshotRenderingMode = snapshotRenderingMode;\n this.snapshotRendering = snapshotRendering;\n this.disableCacheSamplers = disableCacheSamplers;\n this.disableCacheRenderPipelines = disableCacheRenderPipelines;\n this.disableCacheBindGroups = disableCacheBindGroups;\n this.enableGPUTimingMeasurements = enableGPUTimingMeasurements;\n this._currentRenderPass = null;\n });\n });\n }\n })\n .then(() => {\n this._initializeLimits();\n this._bufferManager = new WebGPUBufferManager(this, this._device);\n this._textureHelper = new WebGPUTextureManager(this, this._device, this._bufferManager, this._deviceEnabledExtensions);\n this._cacheSampler = new WebGPUCacheSampler(this._device);\n this._cacheBindGroups = new WebGPUCacheBindGroups(this._device, this._cacheSampler, this);\n this._timestampQuery = new WebGPUTimestampQuery(this, this._device, this._bufferManager);\n this._occlusionQuery = this._device.createQuerySet ? new WebGPUOcclusionQuery(this, this._device, this._bufferManager) : undefined;\n this._bundleList = new WebGPUBundleList(this._device);\n this._snapshotRendering = new WebGPUSnapshotRendering(this, this._snapshotRenderingMode, this._bundleList);\n this._ubInvertY = this._bufferManager.createBuffer(new Float32Array([-1, 0]), WebGPUConstants.BufferUsage.Uniform | WebGPUConstants.BufferUsage.CopyDst, \"UBInvertY\");\n this._ubDontInvertY = this._bufferManager.createBuffer(new Float32Array([1, 0]), WebGPUConstants.BufferUsage.Uniform | WebGPUConstants.BufferUsage.CopyDst, \"UBDontInvertY\");\n if (this.dbgVerboseLogsForFirstFrames) {\n if (this._count === undefined) {\n this._count = 0;\n Logger.Log([\"%c frame #\" + this._count + \" - begin\", \"background: #ffff00\"]);\n }\n }\n this._uploadEncoder = this._device.createCommandEncoder(this._uploadEncoderDescriptor);\n this._renderEncoder = this._device.createCommandEncoder(this._renderEncoderDescriptor);\n this._emptyVertexBuffer = new VertexBuffer(this, [0], \"\", {\n stride: 1,\n offset: 0,\n size: 1,\n label: \"EmptyVertexBuffer\",\n });\n this._cacheRenderPipeline = new WebGPUCacheRenderPipelineTree(this._device, this._emptyVertexBuffer);\n this._depthCullingState = new WebGPUDepthCullingState(this._cacheRenderPipeline);\n this._stencilStateComposer = new WebGPUStencilStateComposer(this._cacheRenderPipeline);\n this._stencilStateComposer.stencilGlobal = this._stencilState;\n this._depthCullingState.depthTest = true;\n this._depthCullingState.depthFunc = Constants.LEQUAL;\n this._depthCullingState.depthMask = true;\n this._textureHelper.setCommandEncoder(this._uploadEncoder);\n this._clearQuad = new WebGPUClearQuad(this._device, this, this._emptyVertexBuffer);\n this._defaultDrawContext = this.createDrawContext();\n this._currentDrawContext = this._defaultDrawContext;\n this._defaultMaterialContext = this.createMaterialContext();\n this._currentMaterialContext = this._defaultMaterialContext;\n this._initializeContextAndSwapChain();\n this._initializeMainAttachments();\n this.resize();\n })\n .catch((e) => {\n Logger.Error(\"A fatal error occurred during WebGPU creation/initialization.\");\n throw e;\n });\n }\n _initGlslang(glslangOptions) {\n glslangOptions = glslangOptions || {};\n glslangOptions = {\n ...WebGPUEngine._GlslangDefaultOptions,\n ...glslangOptions,\n };\n if (glslangOptions.glslang) {\n return Promise.resolve(glslangOptions.glslang);\n }\n if (self.glslang) {\n return self.glslang(glslangOptions.wasmPath);\n }\n if (glslangOptions.jsPath && glslangOptions.wasmPath) {\n return Tools.LoadBabylonScriptAsync(glslangOptions.jsPath).then(() => {\n return self.glslang(Tools.GetBabylonScriptURL(glslangOptions.wasmPath));\n });\n }\n return Promise.reject(\"gslang is not available.\");\n }\n _initializeLimits() {\n // Init caps\n // TODO WEBGPU Real Capability check once limits will be working.\n this._caps = {\n maxTexturesImageUnits: this._deviceLimits.maxSampledTexturesPerShaderStage,\n maxVertexTextureImageUnits: this._deviceLimits.maxSampledTexturesPerShaderStage,\n maxCombinedTexturesImageUnits: this._deviceLimits.maxSampledTexturesPerShaderStage * 2,\n maxTextureSize: this._deviceLimits.maxTextureDimension2D,\n maxCubemapTextureSize: this._deviceLimits.maxTextureDimension2D,\n maxRenderTextureSize: this._deviceLimits.maxTextureDimension2D,\n maxVertexAttribs: this._deviceLimits.maxVertexAttributes,\n maxDrawBuffers: 8,\n maxVaryingVectors: this._deviceLimits.maxInterStageShaderVariables,\n maxFragmentUniformVectors: Math.floor(this._deviceLimits.maxUniformBufferBindingSize / 4),\n maxVertexUniformVectors: Math.floor(this._deviceLimits.maxUniformBufferBindingSize / 4),\n standardDerivatives: true,\n astc: (this._deviceEnabledExtensions.indexOf(\"texture-compression-astc\" /* WebGPUConstants.FeatureName.TextureCompressionASTC */) >= 0 ? true : undefined),\n s3tc: (this._deviceEnabledExtensions.indexOf(\"texture-compression-bc\" /* WebGPUConstants.FeatureName.TextureCompressionBC */) >= 0 ? true : undefined),\n pvrtc: null,\n etc1: null,\n etc2: (this._deviceEnabledExtensions.indexOf(\"texture-compression-etc2\" /* WebGPUConstants.FeatureName.TextureCompressionETC2 */) >= 0 ? true : undefined),\n bptc: this._deviceEnabledExtensions.indexOf(\"texture-compression-bc\" /* WebGPUConstants.FeatureName.TextureCompressionBC */) >= 0 ? true : undefined,\n maxAnisotropy: 16, // Most implementations support maxAnisotropy values in range between 1 and 16, inclusive. The used value of maxAnisotropy will be clamped to the maximum value that the platform supports.\n uintIndices: true,\n fragmentDepthSupported: true,\n highPrecisionShaderSupported: true,\n colorBufferFloat: true,\n supportFloatTexturesResolve: false, // See https://github.com/gpuweb/gpuweb/issues/3844\n rg11b10ufColorRenderable: this._deviceEnabledExtensions.indexOf(\"rg11b10ufloat-renderable\" /* WebGPUConstants.FeatureName.RG11B10UFloatRenderable */) >= 0,\n textureFloat: true,\n textureFloatLinearFiltering: this._deviceEnabledExtensions.indexOf(\"float32-filterable\" /* WebGPUConstants.FeatureName.Float32Filterable */) >= 0,\n textureFloatRender: true,\n textureHalfFloat: true,\n textureHalfFloatLinearFiltering: true,\n textureHalfFloatRender: true,\n textureLOD: true,\n texelFetch: true,\n drawBuffersExtension: true,\n depthTextureExtension: true,\n vertexArrayObject: false,\n instancedArrays: true,\n timerQuery: typeof BigUint64Array !== \"undefined\" && this._deviceEnabledExtensions.indexOf(\"timestamp-query\" /* WebGPUConstants.FeatureName.TimestampQuery */) !== -1 ? true : undefined,\n supportOcclusionQuery: typeof BigUint64Array !== \"undefined\",\n canUseTimestampForTimerQuery: true,\n multiview: false,\n oculusMultiview: false,\n parallelShaderCompile: undefined,\n blendMinMax: true,\n maxMSAASamples: 4, // the spec only supports values of 1 and 4\n canUseGLInstanceID: true,\n canUseGLVertexID: true,\n supportComputeShaders: true,\n supportSRGBBuffers: true,\n supportTransformFeedbacks: false,\n textureMaxLevel: true,\n texture2DArrayMaxLayerCount: this._deviceLimits.maxTextureArrayLayers,\n disableMorphTargetTexture: false,\n textureNorm16: false, // in the works: https://github.com/gpuweb/gpuweb/issues/3001\n };\n this._features = {\n forceBitmapOverHTMLImageElement: true,\n supportRenderAndCopyToLodForFloatTextures: true,\n supportDepthStencilTexture: true,\n supportShadowSamplers: true,\n uniformBufferHardCheckMatrix: false,\n allowTexturePrefiltering: true,\n trackUbosInFrame: true,\n checkUbosContentBeforeUpload: true,\n supportCSM: true,\n basisNeedsPOT: false,\n support3DTextures: true,\n needTypeSuffixInShaderConstants: true,\n supportMSAA: true,\n supportSSAO2: true,\n supportIBLShadows: true,\n supportExtendedTextureFormats: true,\n supportSwitchCaseInShader: true,\n supportSyncTextureRead: false,\n needsInvertingBitmap: false,\n useUBOBindingCache: false,\n needShaderCodeInlining: true,\n needToAlwaysBindUniformBuffers: true,\n supportRenderPasses: true,\n supportSpriteInstancing: true,\n forceVertexBufferStrideAndOffsetMultiple4Bytes: true,\n _checkNonFloatVertexBuffersDontRecreatePipelineContext: true,\n _collectUbosUpdatedInFrame: false,\n };\n }\n _initializeContextAndSwapChain() {\n if (!this._renderingCanvas) {\n // eslint-disable-next-line no-throw-literal\n throw \"The rendering canvas has not been set!\";\n }\n this._context = this._renderingCanvas.getContext(\"webgpu\");\n this._configureContext();\n this._colorFormat = this._options.swapChainFormat;\n this._mainRenderPassWrapper.colorAttachmentGPUTextures = [new WebGPUHardwareTexture(this)];\n this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].format = this._colorFormat;\n this._setColorFormat(this._mainRenderPassWrapper);\n }\n // Set default values as WebGL with depth and stencil attachment for the broadest Compat.\n _initializeMainAttachments() {\n if (!this._bufferManager) {\n return;\n }\n this.flushFramebuffer();\n this._mainTextureExtends = {\n width: this.getRenderWidth(true),\n height: this.getRenderHeight(true),\n depthOrArrayLayers: 1,\n };\n const bufferDataUpdate = new Float32Array([this.getRenderHeight(true)]);\n this._bufferManager.setSubData(this._ubInvertY, 4, bufferDataUpdate);\n this._bufferManager.setSubData(this._ubDontInvertY, 4, bufferDataUpdate);\n let mainColorAttachments;\n if (this._options.antialias) {\n const mainTextureDescriptor = {\n label: `Texture_MainColor_${this._mainTextureExtends.width}x${this._mainTextureExtends.height}_antialiasing`,\n size: this._mainTextureExtends,\n mipLevelCount: 1,\n sampleCount: this._mainPassSampleCount,\n dimension: \"2d\" /* WebGPUConstants.TextureDimension.E2d */,\n format: this._options.swapChainFormat,\n usage: 16 /* WebGPUConstants.TextureUsage.RenderAttachment */,\n };\n if (this._mainTexture) {\n this._textureHelper.releaseTexture(this._mainTexture);\n }\n this._mainTexture = this._device.createTexture(mainTextureDescriptor);\n mainColorAttachments = [\n {\n view: this._mainTexture.createView({\n label: \"TextureView_MainColor_antialiasing\",\n dimension: \"2d\" /* WebGPUConstants.TextureDimension.E2d */,\n format: this._options.swapChainFormat,\n mipLevelCount: 1,\n arrayLayerCount: 1,\n }),\n clearValue: new Color4(0, 0, 0, 1),\n loadOp: \"clear\" /* WebGPUConstants.LoadOp.Clear */,\n storeOp: \"store\" /* WebGPUConstants.StoreOp.Store */, // don't use StoreOp.Discard, else using several cameras with different viewports or using scissors will fail because we call beginRenderPass / endPass several times for the same color attachment!\n },\n ];\n }\n else {\n mainColorAttachments = [\n {\n view: undefined,\n clearValue: new Color4(0, 0, 0, 1),\n loadOp: \"clear\" /* WebGPUConstants.LoadOp.Clear */,\n storeOp: \"store\" /* WebGPUConstants.StoreOp.Store */,\n },\n ];\n }\n this._mainRenderPassWrapper.depthTextureFormat = this.isStencilEnable ? \"depth24plus-stencil8\" /* WebGPUConstants.TextureFormat.Depth24PlusStencil8 */ : \"depth32float\" /* WebGPUConstants.TextureFormat.Depth32Float */;\n this._setDepthTextureFormat(this._mainRenderPassWrapper);\n this._setColorFormat(this._mainRenderPassWrapper);\n const depthTextureDescriptor = {\n label: `Texture_MainDepthStencil_${this._mainTextureExtends.width}x${this._mainTextureExtends.height}`,\n size: this._mainTextureExtends,\n mipLevelCount: 1,\n sampleCount: this._mainPassSampleCount,\n dimension: \"2d\" /* WebGPUConstants.TextureDimension.E2d */,\n format: this._mainRenderPassWrapper.depthTextureFormat,\n usage: 16 /* WebGPUConstants.TextureUsage.RenderAttachment */,\n };\n if (this._depthTexture) {\n this._textureHelper.releaseTexture(this._depthTexture);\n }\n this._depthTexture = this._device.createTexture(depthTextureDescriptor);\n const mainDepthAttachment = {\n view: this._depthTexture.createView({\n label: `TextureView_MainDepthStencil_${this._mainTextureExtends.width}x${this._mainTextureExtends.height}`,\n dimension: \"2d\" /* WebGPUConstants.TextureDimension.E2d */,\n format: this._depthTexture.format,\n mipLevelCount: 1,\n arrayLayerCount: 1,\n }),\n depthClearValue: this._clearDepthValue,\n depthLoadOp: \"clear\" /* WebGPUConstants.LoadOp.Clear */,\n depthStoreOp: \"store\" /* WebGPUConstants.StoreOp.Store */,\n stencilClearValue: this._clearStencilValue,\n stencilLoadOp: !this.isStencilEnable ? undefined : \"clear\" /* WebGPUConstants.LoadOp.Clear */,\n stencilStoreOp: !this.isStencilEnable ? undefined : \"store\" /* WebGPUConstants.StoreOp.Store */,\n };\n this._mainRenderPassWrapper.renderPassDescriptor = {\n label: \"MainRenderPass\",\n colorAttachments: mainColorAttachments,\n depthStencilAttachment: mainDepthAttachment,\n };\n }\n /**\n * Shared initialization across engines types.\n * @param canvas The canvas associated with this instance of the engine.\n */\n _sharedInit(canvas) {\n super._sharedInit(canvas);\n _CommonInit(this, canvas, this._creationOptions);\n }\n _configureContext() {\n this._context.configure({\n device: this._device,\n format: this._options.swapChainFormat,\n usage: 16 /* WebGPUConstants.TextureUsage.RenderAttachment */ | 1 /* WebGPUConstants.TextureUsage.CopySrc */,\n alphaMode: this.premultipliedAlpha ? \"premultiplied\" /* WebGPUConstants.CanvasAlphaMode.Premultiplied */ : \"opaque\" /* WebGPUConstants.CanvasAlphaMode.Opaque */,\n });\n }\n /**\n * Resize an image and returns the image data as an uint8array\n * @param image image to resize\n * @param bufferWidth destination buffer width\n * @param bufferHeight destination buffer height\n * @returns an uint8array containing RGBA values of bufferWidth * bufferHeight size\n */\n resizeImageBitmap(image, bufferWidth, bufferHeight) {\n return ResizeImageBitmap(this, image, bufferWidth, bufferHeight);\n }\n /**\n * Engine abstraction for loading and creating an image bitmap from a given source string.\n * @param imageSource source to load the image from.\n * @param options An object that sets options for the image's extraction.\n * @returns ImageBitmap\n */\n _createImageBitmapFromSource(imageSource, options) {\n return CreateImageBitmapFromSource(this, imageSource, options);\n }\n /**\n * Toggle full screen mode\n * @param requestPointerLock defines if a pointer lock should be requested from the user\n */\n switchFullscreen(requestPointerLock) {\n if (this.isFullscreen) {\n this.exitFullscreen();\n }\n else {\n this.enterFullscreen(requestPointerLock);\n }\n }\n /**\n * Enters full screen mode\n * @param requestPointerLock defines if a pointer lock should be requested from the user\n */\n enterFullscreen(requestPointerLock) {\n if (!this.isFullscreen) {\n this._pointerLockRequested = requestPointerLock;\n if (this._renderingCanvas) {\n RequestFullscreen(this._renderingCanvas);\n }\n }\n }\n /**\n * Exits full screen mode\n */\n exitFullscreen() {\n if (this.isFullscreen) {\n ExitFullscreen();\n }\n }\n /**\n * Enters Pointerlock mode\n */\n enterPointerlock() {\n if (this._renderingCanvas) {\n RequestPointerlock(this._renderingCanvas);\n }\n }\n /**\n * Exits Pointerlock mode\n */\n exitPointerlock() {\n ExitPointerlock();\n }\n _rebuildBuffers() {\n super._rebuildBuffers();\n for (const storageBuffer of this._storageBuffers) {\n // The buffer can already be rebuilt by the call to _rebuildGeometries(), which recreates the storage buffers for the ComputeShaderParticleSystem\n if (storageBuffer.getBuffer().engineId !== this.uniqueId) {\n storageBuffer._rebuild();\n }\n }\n }\n _restoreEngineAfterContextLost(initEngine) {\n WebGPUCacheRenderPipelineTree.ResetCache();\n WebGPUCacheBindGroups.ResetCache();\n // Clear the draw wrappers and material contexts\n const cleanScenes = (scenes) => {\n for (const scene of scenes) {\n for (const mesh of scene.meshes) {\n const subMeshes = mesh.subMeshes;\n if (!subMeshes) {\n continue;\n }\n for (const subMesh of subMeshes) {\n subMesh._drawWrappers = [];\n }\n }\n for (const material of scene.materials) {\n material._materialContext?.reset();\n }\n }\n };\n cleanScenes(this.scenes);\n cleanScenes(this._virtualScenes);\n // The leftOver uniform buffers are removed from the list because they will be recreated when we rebuild the effects\n const uboList = [];\n for (const uniformBuffer of this._uniformBuffers) {\n if (uniformBuffer.name.indexOf(\"leftOver\") < 0) {\n uboList.push(uniformBuffer);\n }\n }\n this._uniformBuffers = uboList;\n super._restoreEngineAfterContextLost(initEngine);\n }\n /**\n * Force a specific size of the canvas\n * @param width defines the new canvas' width\n * @param height defines the new canvas' height\n * @param forceSetSize true to force setting the sizes of the underlying canvas\n * @returns true if the size was changed\n */\n setSize(width, height, forceSetSize = false) {\n if (!super.setSize(width, height, forceSetSize)) {\n return false;\n }\n if (this.dbgVerboseLogsForFirstFrames) {\n if (this._count === undefined) {\n this._count = 0;\n }\n if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {\n Logger.Log([\"frame #\" + this._count + \" - setSize -\", width, height]);\n }\n }\n this._initializeMainAttachments();\n if (this.snapshotRendering) {\n // reset snapshot rendering so that the next frame will record a new list of bundles\n this.snapshotRenderingReset();\n }\n return true;\n }\n /**\n * @internal\n */\n _getShaderProcessor(shaderLanguage) {\n if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {\n return this._shaderProcessorWGSL;\n }\n return this._shaderProcessor;\n }\n /**\n * @internal\n */\n _getShaderProcessingContext(shaderLanguage, pureMode) {\n return new WebGPUShaderProcessingContext(shaderLanguage, pureMode);\n }\n _getCurrentRenderPass() {\n if (this._currentRenderTarget && !this._currentRenderPass) {\n // delayed creation of the render target pass, but we now need to create it as we are requested the render pass\n this._startRenderTargetRenderPass(this._currentRenderTarget, false, null, false, false);\n }\n else if (!this._currentRenderPass) {\n this._startMainRenderPass(false);\n }\n return this._currentRenderPass;\n }\n /** @internal */\n _getCurrentRenderPassWrapper() {\n return this._currentRenderTarget ? this._rttRenderPassWrapper : this._mainRenderPassWrapper;\n }\n //------------------------------------------------------------------------------\n // Static Pipeline WebGPU States\n //------------------------------------------------------------------------------\n /** @internal */\n applyStates() {\n this._stencilStateComposer.apply();\n this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState.alphaBlend);\n }\n /**\n * Force the entire cache to be cleared\n * You should not have to use this function unless your engine needs to share the WebGPU context with another engine\n * @param bruteForce defines a boolean to force clearing ALL caches (including stencil, detoh and alpha states)\n */\n wipeCaches(bruteForce) {\n if (this.preventCacheWipeBetweenFrames && !bruteForce) {\n return;\n }\n //this._currentEffect = null; // can't reset _currentEffect, else some crashes can occur (for eg in ProceduralTexture which calls bindFrameBuffer (which calls wipeCaches) after having called enableEffect and before drawing into the texture)\n // _forceEnableEffect = true assumes the role of _currentEffect = null\n this._forceEnableEffect = true;\n this._currentIndexBuffer = null;\n this._currentOverrideVertexBuffers = null;\n this._cacheRenderPipeline.setBuffers(null, null, null);\n if (bruteForce) {\n this._stencilStateComposer.reset();\n this._depthCullingState.reset();\n this._depthCullingState.depthFunc = Constants.LEQUAL;\n this._alphaState.reset();\n this._alphaMode = Constants.ALPHA_ADD;\n this._alphaEquation = Constants.ALPHA_DISABLE;\n this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters);\n this._cacheRenderPipeline.setAlphaBlendEnabled(false);\n this.setColorWrite(true);\n }\n this._cachedVertexBuffers = null;\n this._cachedIndexBuffer = null;\n this._cachedEffectForVertexBuffers = null;\n }\n /**\n * Enable or disable color writing\n * @param enable defines the state to set\n */\n setColorWrite(enable) {\n this._colorWriteLocal = enable;\n this._cacheRenderPipeline.setWriteMask(enable ? 0xf : 0);\n }\n /**\n * Gets a boolean indicating if color writing is enabled\n * @returns the current color writing state\n */\n getColorWrite() {\n return this._colorWriteLocal;\n }\n _mustUpdateViewport() {\n const x = this._viewportCached.x, y = this._viewportCached.y, w = this._viewportCached.z, h = this._viewportCached.w;\n const update = this._viewportsCurrent.x !== x || this._viewportsCurrent.y !== y || this._viewportsCurrent.w !== w || this._viewportsCurrent.h !== h;\n if (update) {\n this._viewportsCurrent.x = this._viewportCached.x;\n this._viewportsCurrent.y = this._viewportCached.y;\n this._viewportsCurrent.w = this._viewportCached.z;\n this._viewportsCurrent.h = this._viewportCached.w;\n }\n return update;\n }\n _applyViewport(bundleList) {\n const x = Math.floor(this._viewportCached.x);\n const w = Math.floor(this._viewportCached.z);\n const h = Math.floor(this._viewportCached.w);\n let y = Math.floor(this._viewportCached.y);\n if (!this._currentRenderTarget) {\n y = this.getRenderHeight(true) - y - h;\n }\n if (bundleList) {\n bundleList.addItem(new WebGPURenderItemViewport(x, y, w, h));\n }\n else {\n this._getCurrentRenderPass().setViewport(x, y, w, h, 0, 1);\n }\n if (this.dbgVerboseLogsForFirstFrames) {\n if (this._count === undefined) {\n this._count = 0;\n }\n if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {\n Logger.Log([\n \"frame #\" + this._count + \" - viewport applied - (\",\n this._viewportCached.x,\n this._viewportCached.y,\n this._viewportCached.z,\n this._viewportCached.w,\n \") current pass is main pass=\" + this._currentPassIsMainPass(),\n ]);\n }\n }\n }\n /**\n * @internal\n */\n _viewport(x, y, width, height) {\n this._viewportCached.x = x;\n this._viewportCached.y = y;\n this._viewportCached.z = width;\n this._viewportCached.w = height;\n }\n _mustUpdateScissor() {\n const x = this._scissorCached.x, y = this._scissorCached.y, w = this._scissorCached.z, h = this._scissorCached.w;\n const update = this._scissorsCurrent.x !== x || this._scissorsCurrent.y !== y || this._scissorsCurrent.w !== w || this._scissorsCurrent.h !== h;\n if (update) {\n this._scissorsCurrent.x = this._scissorCached.x;\n this._scissorsCurrent.y = this._scissorCached.y;\n this._scissorsCurrent.w = this._scissorCached.z;\n this._scissorsCurrent.h = this._scissorCached.w;\n }\n return update;\n }\n _applyScissor(bundleList) {\n const y = this._currentRenderTarget ? this._scissorCached.y : this.getRenderHeight() - this._scissorCached.w - this._scissorCached.y;\n if (bundleList) {\n bundleList.addItem(new WebGPURenderItemScissor(this._scissorCached.x, y, this._scissorCached.z, this._scissorCached.w));\n }\n else {\n this._getCurrentRenderPass().setScissorRect(this._scissorCached.x, y, this._scissorCached.z, this._scissorCached.w);\n }\n if (this.dbgVerboseLogsForFirstFrames) {\n if (this._count === undefined) {\n this._count = 0;\n }\n if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {\n Logger.Log([\n \"frame #\" + this._count + \" - scissor applied - (\",\n this._scissorCached.x,\n this._scissorCached.y,\n this._scissorCached.z,\n this._scissorCached.w,\n \") current pass is main pass=\" + this._currentPassIsMainPass(),\n ]);\n }\n }\n }\n _scissorIsActive() {\n return this._scissorCached.x !== 0 || this._scissorCached.y !== 0 || this._scissorCached.z !== 0 || this._scissorCached.w !== 0;\n }\n enableScissor(x, y, width, height) {\n this._scissorCached.x = x;\n this._scissorCached.y = y;\n this._scissorCached.z = width;\n this._scissorCached.w = height;\n }\n disableScissor() {\n this._scissorCached.x = this._scissorCached.y = this._scissorCached.z = this._scissorCached.w = 0;\n this._scissorsCurrent.x = this._scissorsCurrent.y = this._scissorsCurrent.w = this._scissorsCurrent.h = 0;\n }\n _mustUpdateStencilRef() {\n const update = this._stencilStateComposer.funcRef !== this._stencilRefsCurrent;\n if (update) {\n this._stencilRefsCurrent = this._stencilStateComposer.funcRef;\n }\n return update;\n }\n _applyStencilRef(bundleList) {\n if (bundleList) {\n bundleList.addItem(new WebGPURenderItemStencilRef(this._stencilStateComposer.funcRef ?? 0));\n }\n else {\n this._getCurrentRenderPass().setStencilReference(this._stencilStateComposer.funcRef ?? 0);\n }\n }\n _mustUpdateBlendColor() {\n const colorBlend = this._alphaState._blendConstants;\n const update = colorBlend[0] !== this._blendColorsCurrent[0] ||\n colorBlend[1] !== this._blendColorsCurrent[1] ||\n colorBlend[2] !== this._blendColorsCurrent[2] ||\n colorBlend[3] !== this._blendColorsCurrent[3];\n if (update) {\n this._blendColorsCurrent[0] = colorBlend[0];\n this._blendColorsCurrent[1] = colorBlend[1];\n this._blendColorsCurrent[2] = colorBlend[2];\n this._blendColorsCurrent[3] = colorBlend[3];\n }\n return update;\n }\n _applyBlendColor(bundleList) {\n if (bundleList) {\n bundleList.addItem(new WebGPURenderItemBlendColor(this._alphaState._blendConstants.slice()));\n }\n else {\n this._getCurrentRenderPass().setBlendConstant(this._alphaState._blendConstants);\n }\n }\n _resetRenderPassStates() {\n this._viewportsCurrent.x = this._viewportsCurrent.y = this._viewportsCurrent.w = this._viewportsCurrent.h = 0;\n this._scissorsCurrent.x = this._scissorsCurrent.y = this._scissorsCurrent.w = this._scissorsCurrent.h = 0;\n this._stencilRefsCurrent = -1;\n this._blendColorsCurrent[0] = this._blendColorsCurrent[1] = this._blendColorsCurrent[2] = this._blendColorsCurrent[3] = null;\n }\n /**\n * Clear the current render buffer or the current render target (if any is set up)\n * @param color defines the color to use\n * @param backBuffer defines if the back buffer must be cleared\n * @param depth defines if the depth buffer must be cleared\n * @param stencil defines if the stencil buffer must be cleared\n */\n clear(color, backBuffer, depth, stencil = false) {\n // Some PGs are using color3...\n if (color && color.a === undefined) {\n color.a = 1;\n }\n const hasScissor = this._scissorIsActive();\n if (this.dbgVerboseLogsForFirstFrames) {\n if (this._count === undefined) {\n this._count = 0;\n }\n if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {\n Logger.Log([\"frame #\" + this._count + \" - clear - backBuffer=\", backBuffer, \" depth=\", depth, \" stencil=\", stencil, \" scissor is active=\", hasScissor]);\n }\n }\n // We need to recreate the render pass so that the new parameters for clear color / depth / stencil are taken into account\n if (this._currentRenderTarget) {\n if (hasScissor) {\n if (!this._currentRenderPass) {\n this._startRenderTargetRenderPass(this._currentRenderTarget, false, backBuffer ? color : null, depth, stencil);\n }\n this._applyScissor(!this.compatibilityMode ? this._bundleList : null);\n this._clearFullQuad(backBuffer ? color : null, depth, stencil);\n }\n else {\n if (this._currentRenderPass) {\n this._endCurrentRenderPass();\n }\n this._startRenderTargetRenderPass(this._currentRenderTarget, true, backBuffer ? color : null, depth, stencil);\n }\n }\n else {\n if (!this._currentRenderPass || !hasScissor) {\n this._startMainRenderPass(!hasScissor, backBuffer ? color : null, depth, stencil);\n }\n if (hasScissor) {\n this._applyScissor(!this.compatibilityMode ? this._bundleList : null);\n this._clearFullQuad(backBuffer ? color : null, depth, stencil);\n }\n }\n }\n _clearFullQuad(clearColor, clearDepth, clearStencil) {\n const renderPass = !this.compatibilityMode ? null : this._getCurrentRenderPass();\n this._clearQuad.setColorFormat(this._colorFormat);\n this._clearQuad.setDepthStencilFormat(this._depthTextureFormat);\n this._clearQuad.setMRTAttachments(this._cacheRenderPipeline.mrtAttachments ?? [], this._cacheRenderPipeline.mrtTextureArray ?? [], this._cacheRenderPipeline.mrtTextureCount);\n if (!this.compatibilityMode) {\n this._bundleList.addItem(new WebGPURenderItemStencilRef(this._clearStencilValue));\n }\n else {\n renderPass.setStencilReference(this._clearStencilValue);\n }\n const bundle = this._clearQuad.clear(renderPass, clearColor, clearDepth, clearStencil, this.currentSampleCount);\n if (!this.compatibilityMode) {\n this._bundleList.addBundle(bundle);\n this._applyStencilRef(this._bundleList);\n this._reportDrawCall();\n }\n else {\n this._applyStencilRef(null);\n }\n }\n //------------------------------------------------------------------------------\n // Vertex/Index/Storage Buffers\n //------------------------------------------------------------------------------\n /**\n * Creates a vertex buffer\n * @param data the data or the size for the vertex buffer\n * @param _updatable whether the buffer should be created as updatable\n * @param label defines the label of the buffer (for debug purpose)\n * @returns the new buffer\n */\n createVertexBuffer(data, _updatable, label) {\n let view;\n if (data instanceof Array) {\n view = new Float32Array(data);\n }\n else if (data instanceof ArrayBuffer) {\n view = new Uint8Array(data);\n }\n else {\n view = data;\n }\n const dataBuffer = this._bufferManager.createBuffer(view, WebGPUConstants.BufferUsage.Vertex | WebGPUConstants.BufferUsage.CopyDst, label);\n return dataBuffer;\n }\n /**\n * Creates a vertex buffer\n * @param data the data for the dynamic vertex buffer\n * @param label defines the label of the buffer (for debug purpose)\n * @returns the new buffer\n */\n createDynamicVertexBuffer(data, label) {\n return this.createVertexBuffer(data, undefined, label);\n }\n /**\n * Creates a new index buffer\n * @param indices defines the content of the index buffer\n * @param _updatable defines if the index buffer must be updatable\n * @param label defines the label of the buffer (for debug purpose)\n * @returns a new buffer\n */\n createIndexBuffer(indices, _updatable, label) {\n let is32Bits = true;\n let view;\n if (indices instanceof Uint32Array || indices instanceof Int32Array) {\n view = indices;\n }\n else if (indices instanceof Uint16Array) {\n view = indices;\n is32Bits = false;\n }\n else {\n if (indices.length > 65535) {\n view = new Uint32Array(indices);\n }\n else {\n view = new Uint16Array(indices);\n is32Bits = false;\n }\n }\n const dataBuffer = this._bufferManager.createBuffer(view, WebGPUConstants.BufferUsage.Index | WebGPUConstants.BufferUsage.CopyDst, label);\n dataBuffer.is32Bits = is32Bits;\n return dataBuffer;\n }\n /**\n * Update a dynamic index buffer\n * @param indexBuffer defines the target index buffer\n * @param indices defines the data to update\n * @param offset defines the offset in the target index buffer where update should start\n */\n updateDynamicIndexBuffer(indexBuffer, indices, offset = 0) {\n const gpuBuffer = indexBuffer;\n let view;\n if (indexBuffer.is32Bits) {\n view = indices instanceof Uint32Array ? indices : new Uint32Array(indices);\n }\n else {\n view = indices instanceof Uint16Array ? indices : new Uint16Array(indices);\n }\n this._bufferManager.setSubData(gpuBuffer, offset, view);\n }\n /**\n * Updates a dynamic vertex buffer.\n * @param vertexBuffer the vertex buffer to update\n * @param data the data used to update the vertex buffer\n * @param byteOffset the byte offset of the data\n * @param byteLength the byte length of the data\n */\n updateDynamicVertexBuffer(vertexBuffer, data, byteOffset, byteLength) {\n const dataBuffer = vertexBuffer;\n if (byteOffset === undefined) {\n byteOffset = 0;\n }\n let view;\n if (byteLength === undefined) {\n if (data instanceof Array) {\n view = new Float32Array(data);\n }\n else if (data instanceof ArrayBuffer) {\n view = new Uint8Array(data);\n }\n else {\n view = data;\n }\n byteLength = view.byteLength;\n }\n else {\n if (data instanceof Array) {\n view = new Float32Array(data);\n }\n else if (data instanceof ArrayBuffer) {\n view = new Uint8Array(data);\n }\n else {\n view = data;\n }\n }\n this._bufferManager.setSubData(dataBuffer, byteOffset, view, 0, byteLength);\n }\n /**\n * @internal\n */\n _createBuffer(data, creationFlags, label) {\n let view;\n if (data instanceof Array) {\n view = new Float32Array(data);\n }\n else if (data instanceof ArrayBuffer) {\n view = new Uint8Array(data);\n }\n else {\n view = data;\n }\n let flags = 0;\n if (creationFlags & Constants.BUFFER_CREATIONFLAG_READ) {\n flags |= WebGPUConstants.BufferUsage.CopySrc;\n }\n if (creationFlags & Constants.BUFFER_CREATIONFLAG_WRITE) {\n flags |= WebGPUConstants.BufferUsage.CopyDst;\n }\n if (creationFlags & Constants.BUFFER_CREATIONFLAG_UNIFORM) {\n flags |= WebGPUConstants.BufferUsage.Uniform;\n }\n if (creationFlags & Constants.BUFFER_CREATIONFLAG_VERTEX) {\n flags |= WebGPUConstants.BufferUsage.Vertex;\n }\n if (creationFlags & Constants.BUFFER_CREATIONFLAG_INDEX) {\n flags |= WebGPUConstants.BufferUsage.Index;\n }\n if (creationFlags & Constants.BUFFER_CREATIONFLAG_STORAGE) {\n flags |= WebGPUConstants.BufferUsage.Storage;\n }\n if (creationFlags & Constants.BUFFER_CREATIONFLAG_INDIRECT) {\n flags |= WebGPUConstants.BufferUsage.Indirect;\n }\n return this._bufferManager.createBuffer(view, flags, label);\n }\n /**\n * @internal\n */\n bindBuffersDirectly() {\n // eslint-disable-next-line no-throw-literal\n throw \"Not implemented on WebGPU\";\n }\n /**\n * @internal\n */\n updateAndBindInstancesBuffer() {\n // eslint-disable-next-line no-throw-literal\n throw \"Not implemented on WebGPU\";\n }\n /**\n * Unbind all instance attributes\n */\n unbindInstanceAttributes() {\n // Does nothing\n }\n /**\n * Bind a list of vertex buffers with the engine\n * @param vertexBuffers defines the list of vertex buffers to bind\n * @param indexBuffer defines the index buffer to bind\n * @param effect defines the effect associated with the vertex buffers\n * @param overrideVertexBuffers defines optional list of avertex buffers that overrides the entries in vertexBuffers\n */\n bindBuffers(vertexBuffers, indexBuffer, effect, overrideVertexBuffers) {\n this._currentIndexBuffer = indexBuffer;\n this._currentOverrideVertexBuffers = overrideVertexBuffers ?? null;\n this._cacheRenderPipeline.setBuffers(vertexBuffers, indexBuffer, this._currentOverrideVertexBuffers);\n }\n /**\n * @internal\n */\n _releaseBuffer(buffer) {\n return this._bufferManager.releaseBuffer(buffer);\n }\n //------------------------------------------------------------------------------\n // Uniform Buffers\n //------------------------------------------------------------------------------\n /**\n * Create an uniform buffer\n * @see https://doc.babylonjs.com/setup/support/webGL2#uniform-buffer-objets\n * @param elements defines the content of the uniform buffer\n * @param label defines a name for the buffer (for debugging purpose)\n * @returns the webGL uniform buffer\n */\n createUniformBuffer(elements, label) {\n let view;\n if (elements instanceof Array) {\n view = new Float32Array(elements);\n }\n else {\n view = elements;\n }\n const dataBuffer = this._bufferManager.createBuffer(view, WebGPUConstants.BufferUsage.Uniform | WebGPUConstants.BufferUsage.CopyDst, label);\n return dataBuffer;\n }\n /**\n * Create a dynamic uniform buffer (no different from a non dynamic uniform buffer in WebGPU)\n * @see https://doc.babylonjs.com/setup/support/webGL2#uniform-buffer-objets\n * @param elements defines the content of the uniform buffer\n * @param label defines a name for the buffer (for debugging purpose)\n * @returns the webGL uniform buffer\n */\n createDynamicUniformBuffer(elements, label) {\n return this.createUniformBuffer(elements, label);\n }\n /**\n * Update an existing uniform buffer\n * @see https://doc.babylonjs.com/setup/support/webGL2#uniform-buffer-objets\n * @param uniformBuffer defines the target uniform buffer\n * @param elements defines the content to update\n * @param offset defines the offset in the uniform buffer where update should start\n * @param count defines the size of the data to update\n */\n updateUniformBuffer(uniformBuffer, elements, offset, count) {\n if (offset === undefined) {\n offset = 0;\n }\n const dataBuffer = uniformBuffer;\n let view;\n if (count === undefined) {\n if (elements instanceof Float32Array) {\n view = elements;\n }\n else {\n view = new Float32Array(elements);\n }\n count = view.byteLength;\n }\n else {\n if (elements instanceof Float32Array) {\n view = elements;\n }\n else {\n view = new Float32Array(elements);\n }\n }\n this._bufferManager.setSubData(dataBuffer, offset, view, 0, count);\n }\n /**\n * Bind a buffer to the current draw context\n * @param buffer defines the buffer to bind\n * @param _location not used in WebGPU\n * @param name Name of the uniform variable to bind\n */\n bindUniformBufferBase(buffer, _location, name) {\n this._currentDrawContext.setBuffer(name, buffer);\n }\n /**\n * Unused in WebGPU\n */\n bindUniformBlock() { }\n //------------------------------------------------------------------------------\n // Effects\n //------------------------------------------------------------------------------\n /**\n * Create a new effect (used to store vertex/fragment shaders)\n * @param baseName defines the base name of the effect (The name of file without .fragment.fx or .vertex.fx)\n * @param attributesNamesOrOptions defines either a list of attribute names or an IEffectCreationOptions object\n * @param uniformsNamesOrEngine defines either a list of uniform names or the engine to use\n * @param samplers defines an array of string used to represent textures\n * @param defines defines the string containing the defines to use to compile the shaders\n * @param fallbacks defines the list of potential fallbacks to use if shader compilation fails\n * @param onCompiled defines a function to call when the effect creation is successful\n * @param onError defines a function to call when the effect creation has failed\n * @param indexParameters defines an object containing the index values to use to compile shaders (like the maximum number of simultaneous lights)\n * @param shaderLanguage the language the shader is written in (default: GLSL)\n * @param extraInitializationsAsync additional async code to run before preparing the effect\n * @returns the new Effect\n */\n createEffect(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, defines, fallbacks, onCompiled, onError, indexParameters, shaderLanguage = 0 /* ShaderLanguage.GLSL */, extraInitializationsAsync) {\n const vertex = typeof baseName === \"string\" ? baseName : baseName.vertexToken || baseName.vertexSource || baseName.vertexElement || baseName.vertex;\n const fragment = typeof baseName === \"string\" ? baseName : baseName.fragmentToken || baseName.fragmentSource || baseName.fragmentElement || baseName.fragment;\n const globalDefines = this._getGlobalDefines();\n let fullDefines = defines ?? attributesNamesOrOptions.defines ?? \"\";\n if (globalDefines) {\n fullDefines += \"\\n\" + globalDefines;\n }\n const name = vertex + \"+\" + fragment + \"@\" + fullDefines;\n if (this._compiledEffects[name]) {\n const compiledEffect = this._compiledEffects[name];\n if (onCompiled && compiledEffect.isReady()) {\n onCompiled(compiledEffect);\n }\n compiledEffect._refCount++;\n return compiledEffect;\n }\n const effect = new Effect(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, this, defines, fallbacks, onCompiled, (effect, errors) => {\n if (onError) {\n onError(effect, errors);\n }\n this.onEffectErrorObservable.notifyObservers({ effect, errors });\n }, indexParameters, name, attributesNamesOrOptions.shaderLanguage ?? shaderLanguage, attributesNamesOrOptions.extraInitializationsAsync ?? extraInitializationsAsync);\n this._compiledEffects[name] = effect;\n return effect;\n }\n _compileRawShaderToSpirV(source, type) {\n return this._glslang.compileGLSL(source, type);\n }\n _compileShaderToSpirV(source, type, defines, shaderVersion) {\n return this._compileRawShaderToSpirV(shaderVersion + (defines ? defines + \"\\n\" : \"\") + source, type);\n }\n _getWGSLShader(source, type, defines) {\n if (defines) {\n defines = \"//\" + defines.split(\"\\n\").join(\"\\n//\") + \"\\n\";\n }\n else {\n defines = \"\";\n }\n return defines + source;\n }\n _createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage, disableUniformityAnalysisInVertex, disableUniformityAnalysisInFragment) {\n if (this._tintWASM && shaderLanguage === 0 /* ShaderLanguage.GLSL */) {\n vertexShader = this._tintWASM.convertSpirV2WGSL(vertexShader, disableUniformityAnalysisInVertex);\n fragmentShader = this._tintWASM.convertSpirV2WGSL(fragmentShader, disableUniformityAnalysisInFragment);\n }\n return {\n vertexStage: {\n module: this._device.createShaderModule({\n label: \"vertex\",\n code: vertexShader,\n }),\n entryPoint: \"main\",\n },\n fragmentStage: {\n module: this._device.createShaderModule({\n label: \"fragment\",\n code: fragmentShader,\n }),\n entryPoint: \"main\",\n },\n };\n }\n _compileRawPipelineStageDescriptor(vertexCode, fragmentCode, shaderLanguage) {\n const disableUniformityAnalysisInVertex = vertexCode.indexOf(Constants.DISABLEUA) >= 0;\n const disableUniformityAnalysisInFragment = fragmentCode.indexOf(Constants.DISABLEUA) >= 0;\n const vertexShader = shaderLanguage === 0 /* ShaderLanguage.GLSL */ ? this._compileRawShaderToSpirV(vertexCode, \"vertex\") : vertexCode;\n const fragmentShader = shaderLanguage === 0 /* ShaderLanguage.GLSL */ ? this._compileRawShaderToSpirV(fragmentCode, \"fragment\") : fragmentCode;\n return this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage, disableUniformityAnalysisInVertex, disableUniformityAnalysisInFragment);\n }\n _compilePipelineStageDescriptor(vertexCode, fragmentCode, defines, shaderLanguage) {\n this.onBeforeShaderCompilationObservable.notifyObservers(this);\n const disableUniformityAnalysisInVertex = vertexCode.indexOf(Constants.DISABLEUA) >= 0;\n const disableUniformityAnalysisInFragment = fragmentCode.indexOf(Constants.DISABLEUA) >= 0;\n const shaderVersion = \"#version 450\\n\";\n const vertexShader = shaderLanguage === 0 /* ShaderLanguage.GLSL */ ? this._compileShaderToSpirV(vertexCode, \"vertex\", defines, shaderVersion) : this._getWGSLShader(vertexCode, \"vertex\", defines);\n const fragmentShader = shaderLanguage === 0 /* ShaderLanguage.GLSL */\n ? this._compileShaderToSpirV(fragmentCode, \"fragment\", defines, shaderVersion)\n : this._getWGSLShader(fragmentCode, \"fragment\", defines);\n const program = this._createPipelineStageDescriptor(vertexShader, fragmentShader, shaderLanguage, disableUniformityAnalysisInVertex, disableUniformityAnalysisInFragment);\n this.onAfterShaderCompilationObservable.notifyObservers(this);\n return program;\n }\n /**\n * @internal\n */\n createRawShaderProgram() {\n // eslint-disable-next-line no-throw-literal\n throw \"Not available on WebGPU\";\n }\n /**\n * @internal\n */\n createShaderProgram() {\n // eslint-disable-next-line no-throw-literal\n throw \"Not available on WebGPU\";\n }\n /**\n * Inline functions in shader code that are marked to be inlined\n * @param code code to inline\n * @returns inlined code\n */\n inlineShaderCode(code) {\n const sci = new ShaderCodeInliner(code);\n sci.debug = false;\n sci.processCode();\n return sci.code;\n }\n /**\n * Creates a new pipeline context\n * @param shaderProcessingContext defines the shader processing context used during the processing if available\n * @returns the new pipeline\n */\n createPipelineContext(shaderProcessingContext) {\n return new WebGPUPipelineContext(shaderProcessingContext, this);\n }\n /**\n * Creates a new material context\n * @returns the new context\n */\n createMaterialContext() {\n return new WebGPUMaterialContext();\n }\n /**\n * Creates a new draw context\n * @returns the new context\n */\n createDrawContext() {\n return new WebGPUDrawContext(this._bufferManager);\n }\n /**\n * @internal\n */\n async _preparePipelineContext(pipelineContext, vertexSourceCode, fragmentSourceCode, createAsRaw, rawVertexSourceCode, rawFragmentSourceCode, _rebuildRebind, defines, _transformFeedbackVaryings, _key, onReady) {\n const webGpuContext = pipelineContext;\n const shaderLanguage = webGpuContext.shaderProcessingContext.shaderLanguage;\n if (shaderLanguage === 0 /* ShaderLanguage.GLSL */ && !this._glslangAndTintAreFullyLoaded) {\n await this.prepareGlslangAndTintAsync();\n }\n if (this.dbgShowShaderCode) {\n Logger.Log([\"defines\", defines]);\n Logger.Log(vertexSourceCode);\n Logger.Log(fragmentSourceCode);\n Logger.Log(\"***********************************************\");\n }\n webGpuContext.sources = {\n fragment: fragmentSourceCode,\n vertex: vertexSourceCode,\n rawVertex: rawVertexSourceCode,\n rawFragment: rawFragmentSourceCode,\n };\n if (createAsRaw) {\n webGpuContext.stages = this._compileRawPipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, shaderLanguage);\n }\n else {\n webGpuContext.stages = this._compilePipelineStageDescriptor(vertexSourceCode, fragmentSourceCode, defines, shaderLanguage);\n }\n onReady();\n }\n /**\n * Gets the list of active attributes for a given WebGPU program\n * @param pipelineContext defines the pipeline context to use\n * @param attributesNames defines the list of attribute names to get\n * @returns an array of indices indicating the offset of each attribute\n */\n getAttributes(pipelineContext, attributesNames) {\n const results = new Array(attributesNames.length);\n const gpuPipelineContext = pipelineContext;\n for (let i = 0; i < attributesNames.length; i++) {\n const attributeName = attributesNames[i];\n const attributeLocation = gpuPipelineContext.shaderProcessingContext.availableAttributes[attributeName];\n if (attributeLocation === undefined) {\n continue;\n }\n results[i] = attributeLocation;\n }\n return results;\n }\n /**\n * Activates an effect, making it the current one (ie. the one used for rendering)\n * @param effect defines the effect to activate\n */\n enableEffect(effect) {\n if (!effect) {\n return;\n }\n if (!IsWrapper(effect)) {\n this._currentEffect = effect;\n this._currentMaterialContext = this._defaultMaterialContext;\n this._currentDrawContext = this._defaultDrawContext;\n this._counters.numEnableEffects++;\n if (this.dbgLogIfNotDrawWrapper) {\n Logger.Warn(`enableEffect has been called with an Effect and not a Wrapper! effect.uniqueId=${effect.uniqueId}, effect.name=${effect.name}, effect.name.vertex=${typeof effect.name === \"string\" ? \"\" : effect.name.vertex}, effect.name.fragment=${typeof effect.name === \"string\" ? \"\" : effect.name.fragment}`, 10);\n }\n }\n else if (!effect.effect ||\n (effect.effect === this._currentEffect &&\n effect.materialContext === this._currentMaterialContext &&\n effect.drawContext === this._currentDrawContext &&\n !this._forceEnableEffect)) {\n if (!effect.effect && this.dbgShowEmptyEnableEffectCalls) {\n Logger.Log([\"drawWrapper=\", effect]);\n // eslint-disable-next-line no-throw-literal\n throw \"Invalid call to enableEffect: the effect property is empty!\";\n }\n return;\n }\n else {\n this._currentEffect = effect.effect;\n this._currentMaterialContext = effect.materialContext;\n this._currentDrawContext = effect.drawContext;\n this._counters.numEnableDrawWrapper++;\n if (!this._currentMaterialContext) {\n Logger.Log([\"drawWrapper=\", effect]);\n // eslint-disable-next-line no-throw-literal\n throw `Invalid call to enableEffect: the materialContext property is empty!`;\n }\n }\n this._stencilStateComposer.stencilMaterial = undefined;\n this._forceEnableEffect = false;\n if (this._currentEffect.onBind) {\n this._currentEffect.onBind(this._currentEffect);\n }\n if (this._currentEffect._onBindObservable) {\n this._currentEffect._onBindObservable.notifyObservers(this._currentEffect);\n }\n }\n /**\n * @internal\n */\n _releaseEffect(effect) {\n if (this._compiledEffects[effect._key]) {\n delete this._compiledEffects[effect._key];\n this._deletePipelineContext(effect.getPipelineContext());\n }\n }\n /**\n * Force the engine to release all cached effects. This means that next effect compilation will have to be done completely even if a similar effect was already compiled\n */\n releaseEffects() {\n for (const name in this._compiledEffects) {\n const webGPUPipelineContext = this._compiledEffects[name].getPipelineContext();\n this._deletePipelineContext(webGPUPipelineContext);\n }\n this._compiledEffects = {};\n }\n _deletePipelineContext(pipelineContext) {\n const webgpuPipelineContext = pipelineContext;\n if (webgpuPipelineContext) {\n resetCachedPipeline(webgpuPipelineContext);\n }\n }\n //------------------------------------------------------------------------------\n // Textures\n //------------------------------------------------------------------------------\n /**\n * Gets a boolean indicating that only power of 2 textures are supported\n * Please note that you can still use non power of 2 textures but in this case the engine will forcefully convert them\n */\n get needPOTTextures() {\n return false;\n }\n /** @internal */\n _createHardwareTexture() {\n return new WebGPUHardwareTexture(this);\n }\n /**\n * @internal\n */\n _releaseTexture(texture) {\n const index = this._internalTexturesCache.indexOf(texture);\n if (index !== -1) {\n this._internalTexturesCache.splice(index, 1);\n }\n this._textureHelper.releaseTexture(texture);\n }\n /**\n * @internal\n */\n _getRGBABufferInternalSizedFormat() {\n return Constants.TEXTUREFORMAT_RGBA;\n }\n updateTextureComparisonFunction(texture, comparisonFunction) {\n texture._comparisonFunction = comparisonFunction;\n }\n /**\n * Creates an internal texture without binding it to a framebuffer\n * @internal\n * @param size defines the size of the texture\n * @param options defines the options used to create the texture\n * @param delayGPUTextureCreation true to delay the texture creation the first time it is really needed. false to create it right away\n * @param source source type of the texture\n * @returns a new internal texture\n */\n _createInternalTexture(size, options, delayGPUTextureCreation = true, source = 0 /* InternalTextureSource.Unknown */) {\n const fullOptions = {};\n if (options !== undefined && typeof options === \"object\") {\n fullOptions.generateMipMaps = options.generateMipMaps;\n fullOptions.createMipMaps = options.createMipMaps;\n fullOptions.type = options.type === undefined ? Constants.TEXTURETYPE_UNSIGNED_BYTE : options.type;\n fullOptions.samplingMode = options.samplingMode === undefined ? Constants.TEXTURE_TRILINEAR_SAMPLINGMODE : options.samplingMode;\n fullOptions.format = options.format === undefined ? Constants.TEXTUREFORMAT_RGBA : options.format;\n fullOptions.samples = options.samples ?? 1;\n fullOptions.creationFlags = options.creationFlags ?? 0;\n fullOptions.useSRGBBuffer = options.useSRGBBuffer ?? false;\n fullOptions.label = options.label;\n }\n else {\n fullOptions.generateMipMaps = options;\n fullOptions.type = Constants.TEXTURETYPE_UNSIGNED_BYTE;\n fullOptions.samplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE;\n fullOptions.format = Constants.TEXTUREFORMAT_RGBA;\n fullOptions.samples = 1;\n fullOptions.creationFlags = 0;\n fullOptions.useSRGBBuffer = false;\n }\n if (fullOptions.type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {\n fullOptions.samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\n }\n else if (fullOptions.type === Constants.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {\n fullOptions.samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\n }\n if (fullOptions.type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloat) {\n fullOptions.type = Constants.TEXTURETYPE_UNSIGNED_BYTE;\n Logger.Warn(\"Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE\");\n }\n const texture = new InternalTexture(this, source);\n const width = size.width || size;\n const height = size.height || size;\n const depth = size.depth || 0;\n const layers = size.layers || 0;\n texture.baseWidth = width;\n texture.baseHeight = height;\n texture.width = width;\n texture.height = height;\n texture.depth = depth || layers;\n texture.isReady = true;\n texture.samples = fullOptions.samples;\n texture.generateMipMaps = !!fullOptions.generateMipMaps;\n texture.samplingMode = fullOptions.samplingMode;\n texture.type = fullOptions.type;\n texture.format = fullOptions.format;\n texture.is2DArray = layers > 0;\n texture.is3D = depth > 0;\n texture._cachedWrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n texture._cachedWrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\n texture._useSRGBBuffer = fullOptions.useSRGBBuffer;\n texture.label = fullOptions.label;\n this._internalTexturesCache.push(texture);\n if (!delayGPUTextureCreation) {\n const createMipMapsOnly = !fullOptions.generateMipMaps && fullOptions.createMipMaps;\n if (createMipMapsOnly) {\n // So that the call to createGPUTextureForInternalTexture creates the mipmaps\n texture.generateMipMaps = true;\n }\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, layers || 1, fullOptions.creationFlags);\n if (createMipMapsOnly) {\n // So that we don't automatically generate mipmaps when the render target is unbound\n texture.generateMipMaps = false;\n }\n }\n return texture;\n }\n /**\n * Usually called from Texture.ts.\n * Passed information to create a hardware texture\n * @param url defines a value which contains one of the following:\n * * A conventional http URL, e.g. 'http://...' or 'file://...'\n * * A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...'\n * * An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg'\n * @param noMipmap defines a boolean indicating that no mipmaps shall be generated. Ignored for compressed textures. They must be in the file\n * @param invertY when true, image is flipped when loaded. You probably want true. Certain compressed textures may invert this if their default is inverted (eg. ktx)\n * @param scene needed for loading to the correct scene\n * @param samplingMode mode with should be used sample / access the texture (Default: Texture.TRILINEAR_SAMPLINGMODE)\n * @param onLoad optional callback to be called upon successful completion\n * @param onError optional callback to be called upon failure\n * @param buffer a source of a file previously fetched as either a base64 string, an ArrayBuffer (compressed or image format), HTMLImageElement (image format), or a Blob\n * @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities\n * @param format internal format. Default: RGB when extension is '.jpg' else RGBA. Ignored for compressed textures\n * @param forcedExtension defines the extension to use to pick the right loader\n * @param mimeType defines an optional mime type\n * @param loaderOptions options to be passed to the loader\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\n * @returns a InternalTexture for assignment back into BABYLON.Texture\n */\n createTexture(url, noMipmap, invertY, scene, samplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE, onLoad = null, onError = null, buffer = null, fallback = null, format = null, forcedExtension = null, mimeType, loaderOptions, creationFlags, useSRGBBuffer) {\n return this._createTextureBase(url, noMipmap, invertY, scene, samplingMode, onLoad, onError, (texture, extension, scene, img, invertY, noMipmap, isCompressed, processFunction) => {\n const imageBitmap = img; // we will never get an HTMLImageElement in WebGPU\n texture.baseWidth = imageBitmap.width;\n texture.baseHeight = imageBitmap.height;\n texture.width = imageBitmap.width;\n texture.height = imageBitmap.height;\n texture.format = texture.format !== -1 ? texture.format : (format ?? Constants.TEXTUREFORMAT_RGBA);\n texture.type = texture.type !== -1 ? texture.type : Constants.TEXTURETYPE_UNSIGNED_BYTE;\n texture._creationFlags = creationFlags ?? 0;\n processFunction(texture.width, texture.height, imageBitmap, extension, texture, () => { });\n if (!texture._hardwareTexture?.underlyingResource) {\n // the texture could have been created before reaching this point so don't recreate it if already existing\n const gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, imageBitmap.width, imageBitmap.height, undefined, creationFlags);\n if (WebGPUTextureHelper.IsImageBitmap(imageBitmap)) {\n this._textureHelper.updateTexture(imageBitmap, texture, imageBitmap.width, imageBitmap.height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, false, 0, 0);\n if (!noMipmap && !isCompressed) {\n this._generateMipmaps(texture, this._uploadEncoder);\n }\n }\n }\n else if (!noMipmap && !isCompressed) {\n this._generateMipmaps(texture, this._uploadEncoder);\n }\n if (scene) {\n scene.removePendingData(texture);\n }\n texture.isReady = true;\n texture.onLoadedObservable.notifyObservers(texture);\n texture.onLoadedObservable.clear();\n }, () => false, buffer, fallback, format, forcedExtension, mimeType, loaderOptions, useSRGBBuffer);\n }\n /**\n * Wraps an external web gpu texture in a Babylon texture.\n * @param texture defines the external texture\n * @returns the babylon internal texture\n */\n wrapWebGPUTexture(texture) {\n const hardwareTexture = new WebGPUHardwareTexture(this, texture);\n const internalTexture = new InternalTexture(this, 0 /* InternalTextureSource.Unknown */, true);\n internalTexture._hardwareTexture = hardwareTexture;\n internalTexture.isReady = true;\n return internalTexture;\n }\n // eslint-disable-next-line jsdoc/require-returns-check\n /**\n * Wraps an external web gl texture in a Babylon texture.\n * @returns the babylon internal texture\n */\n wrapWebGLTexture() {\n throw new Error(\"wrapWebGLTexture is not supported, use wrapWebGPUTexture instead.\");\n }\n /**\n * @internal\n */\n _getUseSRGBBuffer(useSRGBBuffer, _noMipmap) {\n return useSRGBBuffer && this._caps.supportSRGBBuffers;\n }\n /**\n * @internal\n */\n _unpackFlipY(value) { }\n /**\n * Update the sampling mode of a given texture\n * @param samplingMode defines the required sampling mode\n * @param texture defines the texture to update\n * @param generateMipMaps defines whether to generate mipmaps for the texture\n */\n updateTextureSamplingMode(samplingMode, texture, generateMipMaps = false) {\n if (generateMipMaps) {\n texture.generateMipMaps = true;\n this._generateMipmaps(texture);\n }\n texture.samplingMode = samplingMode;\n }\n /**\n * Update the sampling mode of a given texture\n * @param texture defines the texture to update\n * @param wrapU defines the texture wrap mode of the u coordinates\n * @param wrapV defines the texture wrap mode of the v coordinates\n * @param wrapR defines the texture wrap mode of the r coordinates\n */\n updateTextureWrappingMode(texture, wrapU, wrapV = null, wrapR = null) {\n if (wrapU !== null) {\n texture._cachedWrapU = wrapU;\n }\n if (wrapV !== null) {\n texture._cachedWrapV = wrapV;\n }\n if ((texture.is2DArray || texture.is3D) && wrapR !== null) {\n texture._cachedWrapR = wrapR;\n }\n }\n /**\n * Update the dimensions of a texture\n * @param texture texture to update\n * @param width new width of the texture\n * @param height new height of the texture\n * @param depth new depth of the texture\n */\n updateTextureDimensions(texture, width, height, depth = 1) {\n if (!texture._hardwareTexture) {\n // the gpu texture is not created yet, so when it is it will be created with the right dimensions\n return;\n }\n if (texture.width === width && texture.height === height && texture.depth === depth) {\n return;\n }\n const additionalUsages = texture._hardwareTexture.textureAdditionalUsages;\n texture._hardwareTexture.release(); // don't defer the releasing! Else we will release at the end of this frame the gpu texture we are about to create in the next line...\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height, depth, additionalUsages);\n }\n /**\n * @internal\n */\n _setInternalTexture(name, texture, baseName) {\n baseName = baseName ?? name;\n if (this._currentEffect) {\n const webgpuPipelineContext = this._currentEffect._pipelineContext;\n const availableTexture = webgpuPipelineContext.shaderProcessingContext.availableTextures[baseName];\n this._currentMaterialContext.setTexture(name, texture);\n if (availableTexture && availableTexture.autoBindSampler) {\n const samplerName = baseName + Constants.AUTOSAMPLERSUFFIX;\n this._currentMaterialContext.setSampler(samplerName, texture); // we can safely cast to InternalTexture because ExternalTexture always has autoBindSampler = false\n }\n }\n }\n /**\n * Create a cube texture from prefiltered data (ie. the mipmaps contain ready to use data for PBR reflection)\n * @param rootUrl defines the url where the file to load is located\n * @param scene defines the current scene\n * @param lodScale defines scale to apply to the mip map selection\n * @param lodOffset defines offset to apply to the mip map selection\n * @param onLoad defines an optional callback raised when the texture is loaded\n * @param onError defines an optional callback raised if there is an issue to load the texture\n * @param format defines the format of the data\n * @param forcedExtension defines the extension to use to pick the right loader\n * @param createPolynomials defines wheter or not to create polynomails harmonics for the texture\n * @returns the cube texture as an InternalTexture\n */\n createPrefilteredCubeTexture(rootUrl, scene, lodScale, lodOffset, onLoad = null, onError = null, format, forcedExtension = null, createPolynomials = true) {\n const callback = (loadData) => {\n if (!loadData) {\n if (onLoad) {\n onLoad(null);\n }\n return;\n }\n const texture = loadData.texture;\n if (!createPolynomials) {\n texture._sphericalPolynomial = new SphericalPolynomial();\n }\n else if (loadData.info.sphericalPolynomial) {\n texture._sphericalPolynomial = loadData.info.sphericalPolynomial;\n }\n texture._source = 9 /* InternalTextureSource.CubePrefiltered */;\n if (onLoad) {\n onLoad(texture);\n }\n };\n return this.createCubeTexture(rootUrl, scene, null, false, callback, onError, format, forcedExtension, createPolynomials, lodScale, lodOffset);\n }\n /**\n * Sets a texture to the according uniform.\n * @param channel The texture channel\n * @param unused unused parameter\n * @param texture The texture to apply\n * @param name The name of the uniform in the effect\n */\n setTexture(channel, unused, texture, name) {\n this._setTexture(channel, texture, false, false, name, name);\n }\n /**\n * Sets an array of texture to the WebGPU context\n * @param channel defines the channel where the texture array must be set\n * @param unused unused parameter\n * @param textures defines the array of textures to bind\n * @param name name of the channel\n */\n setTextureArray(channel, unused, textures, name) {\n for (let index = 0; index < textures.length; index++) {\n this._setTexture(-1, textures[index], true, false, name + index.toString(), name);\n }\n }\n /**\n * @internal\n */\n _setTexture(channel, texture, \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n isPartOfTextureArray = false, depthStencilTexture = false, name = \"\", baseName) {\n // name == baseName for a texture that is not part of a texture array\n // Else, name is something like 'myTexture0' / 'myTexture1' / ... and baseName is 'myTexture'\n // baseName is used to look up the texture in the shaderProcessingContext.availableTextures map\n // name is used to look up the texture in the _currentMaterialContext.textures map\n baseName = baseName ?? name;\n if (this._currentEffect) {\n if (!texture) {\n this._currentMaterialContext.setTexture(name, null);\n return false;\n }\n // Video\n if (texture.video) {\n texture.update();\n }\n else if (texture.delayLoadState === Constants.DELAYLOADSTATE_NOTLOADED) {\n // Delay loading\n texture.delayLoad();\n return false;\n }\n let internalTexture = null;\n if (depthStencilTexture) {\n internalTexture = texture.depthStencilTexture;\n }\n else if (texture.isReady()) {\n internalTexture = texture.getInternalTexture();\n }\n else if (texture.isCube) {\n internalTexture = this.emptyCubeTexture;\n }\n else if (texture.is3D) {\n internalTexture = this.emptyTexture3D;\n }\n else if (texture.is2DArray) {\n internalTexture = this.emptyTexture2DArray;\n }\n else {\n internalTexture = this.emptyTexture;\n }\n if (internalTexture && !internalTexture.isMultiview) {\n // CUBIC_MODE and SKYBOX_MODE both require CLAMP_TO_EDGE. All other modes use REPEAT.\n if (internalTexture.isCube && internalTexture._cachedCoordinatesMode !== texture.coordinatesMode) {\n internalTexture._cachedCoordinatesMode = texture.coordinatesMode;\n const textureWrapMode = texture.coordinatesMode !== Constants.TEXTURE_CUBIC_MODE && texture.coordinatesMode !== Constants.TEXTURE_SKYBOX_MODE\n ? Constants.TEXTURE_WRAP_ADDRESSMODE\n : Constants.TEXTURE_CLAMP_ADDRESSMODE;\n texture.wrapU = textureWrapMode;\n texture.wrapV = textureWrapMode;\n }\n internalTexture._cachedWrapU = texture.wrapU;\n internalTexture._cachedWrapV = texture.wrapV;\n if (internalTexture.is3D) {\n internalTexture._cachedWrapR = texture.wrapR;\n }\n this._setAnisotropicLevel(0, internalTexture, texture.anisotropicFilteringLevel);\n }\n this._setInternalTexture(name, internalTexture, baseName);\n }\n else {\n if (this.dbgVerboseLogsForFirstFrames) {\n if (this._count === undefined) {\n this._count = 0;\n }\n if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {\n Logger.Log([\"frame #\" + this._count + \" - _setTexture called with a null _currentEffect! texture=\", texture]);\n }\n }\n }\n return true;\n }\n /**\n * @internal\n */\n _setAnisotropicLevel(target, internalTexture, anisotropicFilteringLevel) {\n if (internalTexture._cachedAnisotropicFilteringLevel !== anisotropicFilteringLevel) {\n internalTexture._cachedAnisotropicFilteringLevel = Math.min(anisotropicFilteringLevel, this._caps.maxAnisotropy);\n }\n }\n /**\n * @internal\n */\n _bindTexture(channel, texture, name) {\n if (channel === undefined) {\n return;\n }\n this._setInternalTexture(name, texture);\n }\n /**\n * Generates the mipmaps for a texture\n * @param texture texture to generate the mipmaps for\n */\n generateMipmaps(texture) {\n this._generateMipmaps(texture);\n }\n /**\n * Update a portion of an internal texture\n * @param texture defines the texture to update\n * @param imageData defines the data to store into the texture\n * @param xOffset defines the x coordinates of the update rectangle\n * @param yOffset defines the y coordinates of the update rectangle\n * @param width defines the width of the update rectangle\n * @param height defines the height of the update rectangle\n * @param faceIndex defines the face index if texture is a cube (0 by default)\n * @param lod defines the lod level to update (0 by default)\n * @param generateMipMaps defines whether to generate mipmaps or not\n */\n updateTextureData(texture, imageData, xOffset, yOffset, width, height, faceIndex = 0, lod = 0, generateMipMaps = false) {\n let gpuTextureWrapper = texture._hardwareTexture;\n if (!texture._hardwareTexture?.underlyingResource) {\n gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture);\n }\n const data = new Uint8Array(imageData.buffer, imageData.byteOffset, imageData.byteLength);\n this._textureHelper.updateTexture(data, texture, width, height, texture.depth, gpuTextureWrapper.format, faceIndex, lod, texture.invertY, false, xOffset, yOffset);\n if (generateMipMaps) {\n this._generateMipmaps(texture);\n }\n }\n /**\n * @internal\n */\n _uploadCompressedDataToTextureDirectly(texture, internalFormat, width, height, imageData, faceIndex = 0, lod = 0) {\n let gpuTextureWrapper = texture._hardwareTexture;\n if (!texture._hardwareTexture?.underlyingResource) {\n texture.format = internalFormat;\n gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);\n }\n const data = new Uint8Array(imageData.buffer, imageData.byteOffset, imageData.byteLength);\n this._textureHelper.updateTexture(data, texture, width, height, texture.depth, gpuTextureWrapper.format, faceIndex, lod, false, false, 0, 0);\n }\n /**\n * @internal\n */\n _uploadDataToTextureDirectly(texture, imageData, faceIndex = 0, lod = 0, babylonInternalFormat, useTextureWidthAndHeight = false) {\n const lodMaxWidth = Math.round(Math.log(texture.width) * Math.LOG2E);\n const lodMaxHeight = Math.round(Math.log(texture.height) * Math.LOG2E);\n const width = useTextureWidthAndHeight ? texture.width : Math.pow(2, Math.max(lodMaxWidth - lod, 0));\n const height = useTextureWidthAndHeight ? texture.height : Math.pow(2, Math.max(lodMaxHeight - lod, 0));\n let gpuTextureWrapper = texture._hardwareTexture;\n if (!texture._hardwareTexture?.underlyingResource) {\n gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);\n }\n const data = new Uint8Array(imageData.buffer, imageData.byteOffset, imageData.byteLength);\n this._textureHelper.updateTexture(data, texture, width, height, texture.depth, gpuTextureWrapper.format, faceIndex, lod, texture.invertY, false, 0, 0);\n }\n /**\n * @internal\n */\n _uploadArrayBufferViewToTexture(texture, imageData, faceIndex = 0, lod = 0) {\n this._uploadDataToTextureDirectly(texture, imageData, faceIndex, lod);\n }\n /**\n * @internal\n */\n _uploadImageToTexture(texture, image, faceIndex = 0, lod = 0) {\n let gpuTextureWrapper = texture._hardwareTexture;\n if (!texture._hardwareTexture?.underlyingResource) {\n gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture);\n }\n if (image instanceof HTMLImageElement) {\n // eslint-disable-next-line no-throw-literal\n throw \"WebGPU engine: HTMLImageElement not supported in _uploadImageToTexture!\";\n }\n const bitmap = image; // in WebGPU we will always get an ImageBitmap, not an HTMLImageElement\n const width = Math.ceil(texture.width / (1 << lod));\n const height = Math.ceil(texture.height / (1 << lod));\n this._textureHelper.updateTexture(bitmap, texture, width, height, texture.depth, gpuTextureWrapper.format, faceIndex, lod, texture.invertY, false, 0, 0);\n }\n /**\n * Reads pixels from the current frame buffer. Please note that this function can be slow\n * @param x defines the x coordinate of the rectangle where pixels must be read\n * @param y defines the y coordinate of the rectangle where pixels must be read\n * @param width defines the width of the rectangle where pixels must be read\n * @param height defines the height of the rectangle where pixels must be read\n * @param hasAlpha defines whether the output should have alpha or not (defaults to true)\n * @param flushRenderer true to flush the renderer from the pending commands before reading the pixels\n * @returns a ArrayBufferView promise (Uint8Array) containing RGBA colors\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n readPixels(x, y, width, height, hasAlpha = true, flushRenderer = true) {\n const renderPassWrapper = this._getCurrentRenderPassWrapper();\n const hardwareTexture = renderPassWrapper.colorAttachmentGPUTextures[0];\n if (!hardwareTexture) {\n // we are calling readPixels for a render pass with no color texture bound\n return Promise.resolve(new Uint8Array(0));\n }\n const gpuTexture = hardwareTexture.underlyingResource;\n const gpuTextureFormat = hardwareTexture.format;\n if (!gpuTexture) {\n // we are calling readPixels before startMainRenderPass has been called and no RTT is bound, so swapChainTexture is not setup yet!\n return Promise.resolve(new Uint8Array(0));\n }\n if (flushRenderer) {\n this.flushFramebuffer();\n }\n return this._textureHelper.readPixels(gpuTexture, x, y, width, height, gpuTextureFormat);\n }\n //------------------------------------------------------------------------------\n // Frame management\n //------------------------------------------------------------------------------\n _measureFps() {\n this._performanceMonitor.sampleFrame();\n this._fps = this._performanceMonitor.averageFPS;\n this._deltaTime = this._performanceMonitor.instantaneousFrameTime || 0;\n }\n /**\n * Gets the performance monitor attached to this engine\n * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#engineinstrumentation\n */\n get performanceMonitor() {\n return this._performanceMonitor;\n }\n /**\n * Begin a new frame\n */\n beginFrame() {\n this._measureFps();\n super.beginFrame();\n }\n /**\n * End the current frame\n */\n endFrame() {\n this._endCurrentRenderPass();\n this._snapshotRendering.endFrame();\n this._timestampQuery.endFrame(this._renderEncoder);\n this._timestampIndex = 0;\n this.flushFramebuffer();\n this._textureHelper.destroyDeferredTextures();\n this._bufferManager.destroyDeferredBuffers();\n if (this._features._collectUbosUpdatedInFrame) {\n if (this.dbgVerboseLogsForFirstFrames) {\n if (this._count === undefined) {\n this._count = 0;\n }\n if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {\n const list = [];\n for (const name in UniformBuffer._UpdatedUbosInFrame) {\n list.push(name + \":\" + UniformBuffer._UpdatedUbosInFrame[name]);\n }\n Logger.Log([\"frame #\" + this._count + \" - updated ubos -\", list.join(\", \")]);\n }\n }\n UniformBuffer._UpdatedUbosInFrame = {};\n }\n this.countersLastFrame.numEnableEffects = this._counters.numEnableEffects;\n this.countersLastFrame.numEnableDrawWrapper = this._counters.numEnableDrawWrapper;\n this.countersLastFrame.numBundleCreationNonCompatMode = this._counters.numBundleCreationNonCompatMode;\n this.countersLastFrame.numBundleReuseNonCompatMode = this._counters.numBundleReuseNonCompatMode;\n this._counters.numEnableEffects = 0;\n this._counters.numEnableDrawWrapper = 0;\n this._counters.numBundleCreationNonCompatMode = 0;\n this._counters.numBundleReuseNonCompatMode = 0;\n this._cacheRenderPipeline.endFrame();\n this._cacheBindGroups.endFrame();\n this._pendingDebugCommands.length = 0;\n if (this.dbgVerboseLogsForFirstFrames) {\n if (this._count === undefined) {\n this._count = 0;\n }\n if (this._count < this.dbgVerboseLogsNumFrames) {\n Logger.Log([\"%c frame #\" + this._count + \" - end\", \"background: #ffff00\"]);\n }\n if (this._count < this.dbgVerboseLogsNumFrames) {\n this._count++;\n if (this._count !== this.dbgVerboseLogsNumFrames) {\n Logger.Log([\"%c frame #\" + this._count + \" - begin\", \"background: #ffff00\"]);\n }\n }\n }\n super.endFrame();\n }\n /**Gets driver info if available */\n extractDriverInfo() {\n return \"\";\n }\n /**\n * Force a WebGPU flush (ie. a flush of all waiting commands)\n */\n flushFramebuffer() {\n // we need to end the current render pass (main or rtt) if any as we are not allowed to submit the command buffers when being in a pass\n this._endCurrentRenderPass();\n this._commandBuffers[0] = this._uploadEncoder.finish();\n this._commandBuffers[1] = this._renderEncoder.finish();\n this._device.queue.submit(this._commandBuffers);\n this._uploadEncoder = this._device.createCommandEncoder(this._uploadEncoderDescriptor);\n this._renderEncoder = this._device.createCommandEncoder(this._renderEncoderDescriptor);\n this._timestampQuery.startFrame(this._uploadEncoder);\n this._textureHelper.setCommandEncoder(this._uploadEncoder);\n this._bundleList.reset();\n }\n /** @internal */\n _currentFrameBufferIsDefaultFrameBuffer() {\n return this._currentPassIsMainPass();\n }\n //------------------------------------------------------------------------------\n // Render Pass\n //------------------------------------------------------------------------------\n _startRenderTargetRenderPass(renderTargetWrapper, setClearStates, clearColor, clearDepth, clearStencil) {\n this._endCurrentRenderPass();\n const rtWrapper = renderTargetWrapper;\n const depthStencilTexture = rtWrapper._depthStencilTexture;\n const gpuDepthStencilWrapper = depthStencilTexture?._hardwareTexture;\n const gpuDepthStencilTexture = gpuDepthStencilWrapper?.underlyingResource;\n const gpuDepthStencilMSAATexture = gpuDepthStencilWrapper?.getMSAATexture(0);\n const depthTextureView = gpuDepthStencilTexture?.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor);\n const depthMSAATextureView = gpuDepthStencilMSAATexture?.createView(this._rttRenderPassWrapper.depthAttachmentViewDescriptor);\n const depthTextureHasStencil = gpuDepthStencilWrapper ? WebGPUTextureHelper.HasStencilAspect(gpuDepthStencilWrapper.format) : false;\n const colorAttachments = [];\n if (this.useReverseDepthBuffer) {\n this.setDepthFunctionToGreaterOrEqual();\n }\n const clearColorForIntegerRT = tempColor4;\n if (clearColor) {\n clearColorForIntegerRT.r = clearColor.r * 255;\n clearColorForIntegerRT.g = clearColor.g * 255;\n clearColorForIntegerRT.b = clearColor.b * 255;\n clearColorForIntegerRT.a = clearColor.a * 255;\n }\n const mustClearColor = setClearStates && clearColor;\n const mustClearDepth = setClearStates && clearDepth;\n const mustClearStencil = setClearStates && clearStencil;\n if (rtWrapper._attachments && rtWrapper.isMulti) {\n // multi render targets\n if (!this._mrtAttachments || this._mrtAttachments.length === 0) {\n this._mrtAttachments = rtWrapper._defaultAttachments;\n }\n for (let i = 0; i < this._mrtAttachments.length; ++i) {\n const index = this._mrtAttachments[i]; // if index == 0 it means the texture should not be written to => at render pass creation time, it means we should not clear it\n const mrtTexture = rtWrapper.textures[i];\n const gpuMRTWrapper = mrtTexture?._hardwareTexture;\n const gpuMRTTexture = gpuMRTWrapper?.underlyingResource;\n if (gpuMRTWrapper && gpuMRTTexture) {\n const baseArrayLayer = rtWrapper.getBaseArrayLayer(i);\n const gpuMSAATexture = gpuMRTWrapper.getMSAATexture(baseArrayLayer);\n const viewDescriptor = {\n ...this._rttRenderPassWrapper.colorAttachmentViewDescriptor,\n dimension: mrtTexture.is3D ? \"3d\" /* WebGPUConstants.TextureViewDimension.E3d */ : \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */,\n format: gpuMRTWrapper.format,\n baseArrayLayer,\n };\n const msaaViewDescriptor = {\n ...this._rttRenderPassWrapper.colorAttachmentViewDescriptor,\n dimension: mrtTexture.is3D ? \"3d\" /* WebGPUConstants.TextureViewDimension.E3d */ : \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */,\n format: gpuMRTWrapper.format,\n baseArrayLayer: 0,\n };\n const isRTInteger = mrtTexture.type === Constants.TEXTURETYPE_UNSIGNED_INTEGER || mrtTexture.type === Constants.TEXTURETYPE_UNSIGNED_SHORT;\n const colorTextureView = gpuMRTTexture.createView(viewDescriptor);\n const colorMSAATextureView = gpuMSAATexture?.createView(msaaViewDescriptor);\n colorAttachments.push({\n view: colorMSAATextureView ? colorMSAATextureView : colorTextureView,\n resolveTarget: gpuMSAATexture ? colorTextureView : undefined,\n depthSlice: mrtTexture.is3D ? (rtWrapper.layerIndices?.[i] ?? 0) : undefined,\n clearValue: index !== 0 && mustClearColor ? (isRTInteger ? clearColorForIntegerRT : clearColor) : undefined,\n loadOp: index !== 0 && mustClearColor ? \"clear\" /* WebGPUConstants.LoadOp.Clear */ : \"load\" /* WebGPUConstants.LoadOp.Load */,\n storeOp: \"store\" /* WebGPUConstants.StoreOp.Store */,\n });\n }\n }\n this._cacheRenderPipeline.setMRT(rtWrapper.textures, this._mrtAttachments.length);\n this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments);\n }\n else {\n // single render target\n const internalTexture = rtWrapper.texture;\n if (internalTexture) {\n const gpuWrapper = internalTexture._hardwareTexture;\n const gpuTexture = gpuWrapper.underlyingResource;\n let depthSlice = undefined;\n if (rtWrapper.is3D) {\n depthSlice = this._rttRenderPassWrapper.colorAttachmentViewDescriptor.baseArrayLayer;\n this._rttRenderPassWrapper.colorAttachmentViewDescriptor.baseArrayLayer = 0;\n }\n const gpuMSAATexture = gpuWrapper.getMSAATexture(0);\n const colorTextureView = gpuTexture.createView(this._rttRenderPassWrapper.colorAttachmentViewDescriptor);\n const colorMSAATextureView = gpuMSAATexture?.createView(this._rttRenderPassWrapper.colorAttachmentViewDescriptor);\n const isRTInteger = internalTexture.type === Constants.TEXTURETYPE_UNSIGNED_INTEGER || internalTexture.type === Constants.TEXTURETYPE_UNSIGNED_SHORT;\n colorAttachments.push({\n view: colorMSAATextureView ? colorMSAATextureView : colorTextureView,\n resolveTarget: gpuMSAATexture ? colorTextureView : undefined,\n depthSlice,\n clearValue: mustClearColor ? (isRTInteger ? clearColorForIntegerRT : clearColor) : undefined,\n loadOp: mustClearColor ? \"clear\" /* WebGPUConstants.LoadOp.Clear */ : \"load\" /* WebGPUConstants.LoadOp.Load */,\n storeOp: \"store\" /* WebGPUConstants.StoreOp.Store */,\n });\n }\n else {\n colorAttachments.push(null);\n }\n }\n this._debugPushGroup?.(\"render target pass\" + (renderTargetWrapper.label ? \" (\" + renderTargetWrapper.label + \")\" : \"\"), 0);\n this._rttRenderPassWrapper.renderPassDescriptor = {\n label: (renderTargetWrapper.label ?? \"RTT\") + \" - RenderPass\",\n colorAttachments,\n depthStencilAttachment: depthStencilTexture && gpuDepthStencilTexture\n ? {\n view: depthMSAATextureView ? depthMSAATextureView : depthTextureView,\n depthClearValue: mustClearDepth ? (this.useReverseDepthBuffer ? this._clearReverseDepthValue : this._clearDepthValue) : undefined,\n depthLoadOp: mustClearDepth ? \"clear\" /* WebGPUConstants.LoadOp.Clear */ : \"load\" /* WebGPUConstants.LoadOp.Load */,\n depthStoreOp: \"store\" /* WebGPUConstants.StoreOp.Store */,\n stencilClearValue: rtWrapper._depthStencilTextureWithStencil && mustClearStencil ? this._clearStencilValue : undefined,\n stencilLoadOp: !depthTextureHasStencil\n ? undefined\n : rtWrapper._depthStencilTextureWithStencil && mustClearStencil\n ? \"clear\" /* WebGPUConstants.LoadOp.Clear */\n : \"load\" /* WebGPUConstants.LoadOp.Load */,\n stencilStoreOp: !depthTextureHasStencil ? undefined : \"store\" /* WebGPUConstants.StoreOp.Store */,\n }\n : undefined,\n occlusionQuerySet: this._occlusionQuery?.hasQueries ? this._occlusionQuery.querySet : undefined,\n };\n this._timestampQuery.startPass(this._rttRenderPassWrapper.renderPassDescriptor, this._timestampIndex);\n this._currentRenderPass = this._renderEncoder.beginRenderPass(this._rttRenderPassWrapper.renderPassDescriptor);\n if (this.dbgVerboseLogsForFirstFrames) {\n if (this._count === undefined) {\n this._count = 0;\n }\n if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {\n const internalTexture = rtWrapper.texture;\n Logger.Log([\n \"frame #\" +\n this._count +\n \" - render target begin pass - rtt name=\" +\n renderTargetWrapper.label +\n \", internalTexture.uniqueId=\" +\n internalTexture.uniqueId +\n \", width=\" +\n internalTexture.width +\n \", height=\" +\n internalTexture.height +\n \", setClearStates=\" +\n setClearStates,\n \"renderPassDescriptor=\",\n this._rttRenderPassWrapper.renderPassDescriptor,\n ]);\n }\n }\n this._debugFlushPendingCommands?.();\n this._resetRenderPassStates();\n if (!gpuDepthStencilWrapper || !WebGPUTextureHelper.HasStencilAspect(gpuDepthStencilWrapper.format)) {\n this._stencilStateComposer.enabled = false;\n }\n }\n _startMainRenderPass(setClearStates, clearColor, clearDepth, clearStencil) {\n this._endCurrentRenderPass();\n if (this.useReverseDepthBuffer) {\n this.setDepthFunctionToGreaterOrEqual();\n }\n const mustClearColor = setClearStates && clearColor;\n const mustClearDepth = setClearStates && clearDepth;\n const mustClearStencil = setClearStates && clearStencil;\n this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].clearValue = mustClearColor ? clearColor : undefined;\n this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].loadOp = mustClearColor ? \"clear\" /* WebGPUConstants.LoadOp.Clear */ : \"load\" /* WebGPUConstants.LoadOp.Load */;\n this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.depthClearValue = mustClearDepth\n ? this.useReverseDepthBuffer\n ? this._clearReverseDepthValue\n : this._clearDepthValue\n : undefined;\n this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.depthLoadOp = mustClearDepth ? \"clear\" /* WebGPUConstants.LoadOp.Clear */ : \"load\" /* WebGPUConstants.LoadOp.Load */;\n this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.stencilClearValue = mustClearStencil ? this._clearStencilValue : undefined;\n this._mainRenderPassWrapper.renderPassDescriptor.depthStencilAttachment.stencilLoadOp = !this.isStencilEnable\n ? undefined\n : mustClearStencil\n ? \"clear\" /* WebGPUConstants.LoadOp.Clear */\n : \"load\" /* WebGPUConstants.LoadOp.Load */;\n this._mainRenderPassWrapper.renderPassDescriptor.occlusionQuerySet = this._occlusionQuery?.hasQueries ? this._occlusionQuery.querySet : undefined;\n const swapChainTexture = this._context.getCurrentTexture();\n this._mainRenderPassWrapper.colorAttachmentGPUTextures[0].set(swapChainTexture);\n // Resolve in case of MSAA\n if (this._options.antialias) {\n viewDescriptorSwapChainAntialiasing.format = swapChainTexture.format;\n this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].resolveTarget = swapChainTexture.createView(viewDescriptorSwapChainAntialiasing);\n }\n else {\n viewDescriptorSwapChain.format = swapChainTexture.format;\n this._mainRenderPassWrapper.renderPassDescriptor.colorAttachments[0].view = swapChainTexture.createView(viewDescriptorSwapChain);\n }\n if (this.dbgVerboseLogsForFirstFrames) {\n if (this._count === undefined) {\n this._count = 0;\n }\n if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {\n Logger.Log([\n \"frame #\" + this._count + \" - main begin pass - texture width=\" + this._mainTextureExtends.width,\n \" height=\" + this._mainTextureExtends.height + \", setClearStates=\" + setClearStates,\n \"renderPassDescriptor=\",\n this._mainRenderPassWrapper.renderPassDescriptor,\n ]);\n }\n }\n this._debugPushGroup?.(\"main pass\", 0);\n this._timestampQuery.startPass(this._mainRenderPassWrapper.renderPassDescriptor, this._timestampIndex);\n this._currentRenderPass = this._renderEncoder.beginRenderPass(this._mainRenderPassWrapper.renderPassDescriptor);\n this._setDepthTextureFormat(this._mainRenderPassWrapper);\n this._setColorFormat(this._mainRenderPassWrapper);\n this._debugFlushPendingCommands?.();\n this._resetRenderPassStates();\n if (!this._isStencilEnable) {\n this._stencilStateComposer.enabled = false;\n }\n }\n /**\n * Binds the frame buffer to the specified texture.\n * @param texture The render target wrapper to render to\n * @param faceIndex The face of the texture to render to in case of cube texture\n * @param requiredWidth The width of the target to render to\n * @param requiredHeight The height of the target to render to\n * @param forceFullscreenViewport Forces the viewport to be the entire texture/screen if true\n * @param lodLevel defines the lod level to bind to the frame buffer\n * @param layer defines the 2d array index to bind to frame buffer to\n */\n bindFramebuffer(texture, faceIndex = 0, requiredWidth, requiredHeight, forceFullscreenViewport, lodLevel = 0, layer = 0) {\n const hardwareTexture = texture.texture?._hardwareTexture;\n if (this._currentRenderTarget) {\n this.unBindFramebuffer(this._currentRenderTarget);\n }\n else {\n this._endCurrentRenderPass();\n }\n this._currentRenderTarget = texture;\n const depthStencilTexture = this._currentRenderTarget._depthStencilTexture;\n this._rttRenderPassWrapper.colorAttachmentGPUTextures[0] = hardwareTexture;\n this._rttRenderPassWrapper.depthTextureFormat = depthStencilTexture ? WebGPUTextureHelper.GetWebGPUTextureFormat(-1, depthStencilTexture.format) : undefined;\n this._setDepthTextureFormat(this._rttRenderPassWrapper);\n this._setColorFormat(this._rttRenderPassWrapper);\n this._rttRenderPassWrapper.colorAttachmentViewDescriptor = {\n format: this._colorFormat,\n dimension: texture.is3D ? \"3d\" /* WebGPUConstants.TextureViewDimension.E3d */ : \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */,\n mipLevelCount: 1,\n baseArrayLayer: texture.isCube ? layer * 6 + faceIndex : layer,\n baseMipLevel: lodLevel,\n arrayLayerCount: 1,\n aspect: \"all\" /* WebGPUConstants.TextureAspect.All */,\n };\n this._rttRenderPassWrapper.depthAttachmentViewDescriptor = {\n format: this._depthTextureFormat,\n dimension: depthStencilTexture && depthStencilTexture.is3D ? \"3d\" /* WebGPUConstants.TextureViewDimension.E3d */ : \"2d\" /* WebGPUConstants.TextureViewDimension.E2d */,\n mipLevelCount: 1,\n baseArrayLayer: depthStencilTexture ? (depthStencilTexture.isCube ? layer * 6 + faceIndex : layer) : 0,\n baseMipLevel: 0,\n arrayLayerCount: 1,\n aspect: \"all\" /* WebGPUConstants.TextureAspect.All */,\n };\n if (this.dbgVerboseLogsForFirstFrames) {\n if (this._count === undefined) {\n this._count = 0;\n }\n if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {\n Logger.Log([\n \"frame #\" +\n this._count +\n \" - bindFramebuffer - rtt name=\" +\n texture.label +\n \", internalTexture.uniqueId=\" +\n texture.texture?.uniqueId +\n \", face=\" +\n faceIndex +\n \", lodLevel=\" +\n lodLevel +\n \", layer=\" +\n layer,\n \"colorAttachmentViewDescriptor=\",\n this._rttRenderPassWrapper.colorAttachmentViewDescriptor,\n \"depthAttachmentViewDescriptor=\",\n this._rttRenderPassWrapper.depthAttachmentViewDescriptor,\n ]);\n }\n }\n // We don't create the render pass just now, we do a lazy creation of the render pass, hoping the render pass will be created by a call to clear()...\n if (this._cachedViewport && !forceFullscreenViewport) {\n this.setViewport(this._cachedViewport, requiredWidth, requiredHeight);\n }\n else {\n if (!requiredWidth) {\n requiredWidth = texture.width;\n if (lodLevel) {\n requiredWidth = requiredWidth / Math.pow(2, lodLevel);\n }\n }\n if (!requiredHeight) {\n requiredHeight = texture.height;\n if (lodLevel) {\n requiredHeight = requiredHeight / Math.pow(2, lodLevel);\n }\n }\n this._viewport(0, 0, requiredWidth, requiredHeight);\n }\n this.wipeCaches();\n }\n /**\n * Unbind the current render target texture from the WebGPU context\n * @param texture defines the render target wrapper to unbind\n * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated\n * @param onBeforeUnbind defines a function which will be called before the effective unbind\n */\n unBindFramebuffer(texture, disableGenerateMipMaps = false, onBeforeUnbind) {\n const saveCRT = this._currentRenderTarget;\n this._currentRenderTarget = null; // to be iso with abstractEngine, this._currentRenderTarget must be null when onBeforeUnbind is called\n if (onBeforeUnbind) {\n onBeforeUnbind();\n }\n this._currentRenderTarget = saveCRT;\n this._endCurrentRenderPass();\n if (!disableGenerateMipMaps) {\n if (texture.isMulti) {\n this.generateMipMapsMultiFramebuffer(texture);\n }\n else {\n this.generateMipMapsFramebuffer(texture);\n }\n }\n this._currentRenderTarget = null;\n if (this.dbgVerboseLogsForFirstFrames) {\n if (this._count === undefined) {\n this._count = 0;\n }\n if (!this._count || this._count < this.dbgVerboseLogsNumFrames) {\n Logger.Log(\"frame #\" + this._count + \" - unBindFramebuffer - rtt name=\" + texture.label + \", internalTexture.uniqueId=\", texture.texture?.uniqueId);\n }\n }\n this._mrtAttachments = [];\n this._cacheRenderPipeline.setMRT([]);\n this._cacheRenderPipeline.setMRTAttachments(this._mrtAttachments);\n }\n /**\n * Generates mipmaps for the texture of the (single) render target\n * @param texture The render target containing the texture to generate the mipmaps for\n */\n generateMipMapsFramebuffer(texture) {\n if (!texture.isMulti && texture.texture?.generateMipMaps && !texture.isCube) {\n this._generateMipmaps(texture.texture);\n }\n }\n /**\n * Resolves the MSAA texture of the (single) render target into its non-MSAA version.\n * Note that if \"texture\" is not a MSAA render target, no resolve is performed.\n * @param _texture The render target texture containing the MSAA texture to resolve\n */\n resolveFramebuffer(_texture) {\n throw new Error(\"resolveFramebuffer is not yet implemented in WebGPU!\");\n }\n /**\n * Unbind the current render target and bind the default framebuffer\n */\n restoreDefaultFramebuffer() {\n if (this._currentRenderTarget) {\n this.unBindFramebuffer(this._currentRenderTarget);\n }\n else if (!this._currentRenderPass) {\n this._startMainRenderPass(false);\n }\n if (this._cachedViewport) {\n this.setViewport(this._cachedViewport);\n }\n this.wipeCaches();\n }\n //------------------------------------------------------------------------------\n // Render\n //------------------------------------------------------------------------------\n /**\n * @internal\n */\n _setColorFormat(wrapper) {\n const format = wrapper.colorAttachmentGPUTextures[0]?.format ?? null;\n this._cacheRenderPipeline.setColorFormat(format);\n if (this._colorFormat === format) {\n return;\n }\n this._colorFormat = format;\n }\n /**\n * @internal\n */\n _setDepthTextureFormat(wrapper) {\n this._cacheRenderPipeline.setDepthStencilFormat(wrapper.depthTextureFormat);\n if (this._depthTextureFormat === wrapper.depthTextureFormat) {\n return;\n }\n this._depthTextureFormat = wrapper.depthTextureFormat;\n }\n setDitheringState() {\n // Does not exist in WebGPU\n }\n setRasterizerState() {\n // Does not exist in WebGPU\n }\n /**\n * @internal\n */\n _executeWhenRenderingStateIsCompiled(pipelineContext, action) {\n // No parallel shader compilation.\n // No Async, so direct launch\n action();\n }\n /**\n * @internal\n */\n bindSamplers() { }\n /** @internal */\n _getUnpackAlignement() {\n return 1;\n }\n /**\n * @internal\n */\n _bindTextureDirectly() {\n return false;\n }\n /**\n * Set various states to the webGL context\n * @param culling defines culling state: true to enable culling, false to disable it\n * @param zOffset defines the value to apply to zOffset (0 by default)\n * @param force defines if states must be applied even if cache is up to date\n * @param reverseSide defines if culling must be reversed (CCW if false, CW if true)\n * @param cullBackFaces true to cull back faces, false to cull front faces (if culling is enabled)\n * @param stencil stencil states to set\n * @param zOffsetUnits defines the value to apply to zOffsetUnits (0 by default)\n */\n setState(culling, zOffset = 0, force, reverseSide = false, cullBackFaces, stencil, zOffsetUnits = 0) {\n // Culling\n if (this._depthCullingState.cull !== culling || force) {\n this._depthCullingState.cull = culling;\n }\n // Cull face\n const cullFace = (this.cullBackFaces ?? cullBackFaces ?? true) ? 1 : 2;\n if (this._depthCullingState.cullFace !== cullFace || force) {\n this._depthCullingState.cullFace = cullFace;\n }\n // Z offset\n this.setZOffset(zOffset);\n this.setZOffsetUnits(zOffsetUnits);\n // Front face\n const frontFace = reverseSide ? (this._currentRenderTarget ? 1 : 2) : this._currentRenderTarget ? 2 : 1;\n if (this._depthCullingState.frontFace !== frontFace || force) {\n this._depthCullingState.frontFace = frontFace;\n }\n this._stencilStateComposer.stencilMaterial = stencil;\n }\n _applyRenderPassChanges(bundleList) {\n const mustUpdateStencilRef = !this._stencilStateComposer.enabled ? false : this._mustUpdateStencilRef();\n const mustUpdateBlendColor = !this._alphaState.alphaBlend ? false : this._mustUpdateBlendColor();\n if (this._mustUpdateViewport()) {\n this._applyViewport(bundleList);\n }\n if (this._mustUpdateScissor()) {\n this._applyScissor(bundleList);\n }\n if (mustUpdateStencilRef) {\n this._applyStencilRef(bundleList);\n }\n if (mustUpdateBlendColor) {\n this._applyBlendColor(bundleList);\n }\n }\n _draw(drawType, fillMode, start, count, instancesCount) {\n const renderPass = this._getCurrentRenderPass();\n const bundleList = this._bundleList;\n this.applyStates();\n const webgpuPipelineContext = this._currentEffect._pipelineContext;\n this.bindUniformBufferBase(this._currentRenderTarget ? this._ubInvertY : this._ubDontInvertY, 0, WebGPUShaderProcessor.InternalsUBOName);\n if (webgpuPipelineContext.uniformBuffer) {\n webgpuPipelineContext.uniformBuffer.update();\n this.bindUniformBufferBase(webgpuPipelineContext.uniformBuffer.getBuffer(), 0, WebGPUShaderProcessor.LeftOvertUBOName);\n }\n if (this._snapshotRendering.play) {\n this._reportDrawCall();\n return;\n }\n if (!this.compatibilityMode &&\n (this._currentDrawContext.isDirty(this._currentMaterialContext.updateId) || this._currentMaterialContext.isDirty || this._currentMaterialContext.forceBindGroupCreation)) {\n this._currentDrawContext.fastBundle = undefined;\n }\n const useFastPath = !this.compatibilityMode && this._currentDrawContext.fastBundle;\n let renderPass2 = renderPass;\n if (useFastPath || this._snapshotRendering.record) {\n this._applyRenderPassChanges(bundleList);\n if (!this._snapshotRendering.record) {\n this._counters.numBundleReuseNonCompatMode++;\n if (this._currentDrawContext.indirectDrawBuffer) {\n this._currentDrawContext.setIndirectData(count, instancesCount || 1, start);\n }\n bundleList.addBundle(this._currentDrawContext.fastBundle);\n this._reportDrawCall();\n return;\n }\n renderPass2 = bundleList.getBundleEncoder(this._cacheRenderPipeline.colorFormats, this._depthTextureFormat, this.currentSampleCount); // for snapshot recording mode\n bundleList.numDrawCalls++;\n }\n let textureState = 0;\n if (this._currentMaterialContext.hasFloatOrDepthTextures) {\n let bitVal = 1;\n for (let i = 0; i < webgpuPipelineContext.shaderProcessingContext.textureNames.length; ++i) {\n const textureName = webgpuPipelineContext.shaderProcessingContext.textureNames[i];\n const texture = this._currentMaterialContext.textures[textureName]?.texture;\n const textureIsDepth = texture && texture.format >= Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 && texture.format <= Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8;\n if ((texture?.type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) || textureIsDepth) {\n textureState |= bitVal;\n }\n bitVal = bitVal << 1;\n }\n }\n this._currentMaterialContext.textureState = textureState;\n const pipeline = this._cacheRenderPipeline.getRenderPipeline(fillMode, this._currentEffect, this.currentSampleCount, textureState);\n const bindGroups = this._cacheBindGroups.getBindGroups(webgpuPipelineContext, this._currentDrawContext, this._currentMaterialContext);\n if (!this._snapshotRendering.record) {\n this._applyRenderPassChanges(!this.compatibilityMode ? bundleList : null);\n if (!this.compatibilityMode) {\n this._counters.numBundleCreationNonCompatMode++;\n renderPass2 = this._device.createRenderBundleEncoder({\n colorFormats: this._cacheRenderPipeline.colorFormats,\n depthStencilFormat: this._depthTextureFormat,\n sampleCount: WebGPUTextureHelper.GetSample(this.currentSampleCount),\n });\n }\n }\n // bind pipeline\n renderPass2.setPipeline(pipeline);\n // bind index/vertex buffers\n if (this._currentIndexBuffer) {\n renderPass2.setIndexBuffer(this._currentIndexBuffer.underlyingResource, this._currentIndexBuffer.is32Bits ? \"uint32\" /* WebGPUConstants.IndexFormat.Uint32 */ : \"uint16\" /* WebGPUConstants.IndexFormat.Uint16 */, 0);\n }\n const vertexBuffers = this._cacheRenderPipeline.vertexBuffers;\n for (let index = 0; index < vertexBuffers.length; index++) {\n const vertexBuffer = vertexBuffers[index];\n const buffer = vertexBuffer.effectiveBuffer;\n if (buffer) {\n renderPass2.setVertexBuffer(index, buffer.underlyingResource, vertexBuffer._validOffsetRange ? 0 : vertexBuffer.byteOffset);\n }\n }\n // bind bind groups\n for (let i = 0; i < bindGroups.length; i++) {\n renderPass2.setBindGroup(i, bindGroups[i]);\n }\n // draw\n const nonCompatMode = !this.compatibilityMode && !this._snapshotRendering.record;\n if (nonCompatMode && this._currentDrawContext.indirectDrawBuffer) {\n this._currentDrawContext.setIndirectData(count, instancesCount || 1, start);\n if (drawType === 0) {\n renderPass2.drawIndexedIndirect(this._currentDrawContext.indirectDrawBuffer, 0);\n }\n else {\n renderPass2.drawIndirect(this._currentDrawContext.indirectDrawBuffer, 0);\n }\n }\n else if (drawType === 0) {\n renderPass2.drawIndexed(count, instancesCount || 1, start, 0, 0);\n }\n else {\n renderPass2.draw(count, instancesCount || 1, start, 0);\n }\n if (nonCompatMode) {\n this._currentDrawContext.fastBundle = renderPass2.finish();\n bundleList.addBundle(this._currentDrawContext.fastBundle);\n }\n this._reportDrawCall();\n }\n /**\n * Draw a list of indexed primitives\n * @param fillMode defines the primitive to use\n * @param indexStart defines the starting index\n * @param indexCount defines the number of index to draw\n * @param instancesCount defines the number of instances to draw (if instantiation is enabled)\n */\n drawElementsType(fillMode, indexStart, indexCount, instancesCount = 1) {\n this._draw(0, fillMode, indexStart, indexCount, instancesCount);\n }\n /**\n * Draw a list of unindexed primitives\n * @param fillMode defines the primitive to use\n * @param verticesStart defines the index of first vertex to draw\n * @param verticesCount defines the count of vertices to draw\n * @param instancesCount defines the number of instances to draw (if instantiation is enabled)\n */\n drawArraysType(fillMode, verticesStart, verticesCount, instancesCount = 1) {\n this._currentIndexBuffer = null;\n this._draw(1, fillMode, verticesStart, verticesCount, instancesCount);\n }\n //------------------------------------------------------------------------------\n // Dispose\n //------------------------------------------------------------------------------\n /**\n * Dispose and release all associated resources\n */\n dispose() {\n this._isDisposed = true;\n this.hideLoadingUI();\n this._timestampQuery.dispose();\n this._mainTexture?.destroy();\n this._depthTexture?.destroy();\n this._textureHelper.destroyDeferredTextures();\n this._bufferManager.destroyDeferredBuffers();\n this._device.destroy();\n _CommonDispose(this, this._renderingCanvas);\n super.dispose();\n }\n //------------------------------------------------------------------------------\n // Misc\n //------------------------------------------------------------------------------\n /**\n * Gets the current render width\n * @param useScreen defines if screen size must be used (or the current render target if any)\n * @returns a number defining the current render width\n */\n getRenderWidth(useScreen = false) {\n if (!useScreen && this._currentRenderTarget) {\n return this._currentRenderTarget.width;\n }\n return this._renderingCanvas?.width ?? 0;\n }\n /**\n * Gets the current render height\n * @param useScreen defines if screen size must be used (or the current render target if any)\n * @returns a number defining the current render height\n */\n getRenderHeight(useScreen = false) {\n if (!useScreen && this._currentRenderTarget) {\n return this._currentRenderTarget.height;\n }\n return this._renderingCanvas?.height ?? 0;\n }\n //------------------------------------------------------------------------------\n // Errors\n //------------------------------------------------------------------------------\n /**\n * Get the current error code of the WebGPU context\n * @returns the error code\n */\n getError() {\n // TODO WEBGPU. from the webgpu errors.\n return 0;\n }\n //------------------------------------------------------------------------------\n // External Textures\n //------------------------------------------------------------------------------\n /**\n * Creates an external texture\n * @param video video element\n * @returns the external texture, or null if external textures are not supported by the engine\n */\n createExternalTexture(video) {\n const texture = new WebGPUExternalTexture(video);\n return texture;\n }\n /**\n * Sets an internal texture to the according uniform.\n * @param name The name of the uniform in the effect\n * @param texture The texture to apply\n */\n setExternalTexture(name, texture) {\n if (!texture) {\n this._currentMaterialContext.setTexture(name, null);\n return;\n }\n this._setInternalTexture(name, texture);\n }\n //------------------------------------------------------------------------------\n // Samplers\n //------------------------------------------------------------------------------\n /**\n * Sets a texture sampler to the according uniform.\n * @param name The name of the uniform in the effect\n * @param sampler The sampler to apply\n */\n setTextureSampler(name, sampler) {\n this._currentMaterialContext?.setSampler(name, sampler);\n }\n //------------------------------------------------------------------------------\n // Storage Buffers\n //------------------------------------------------------------------------------\n /**\n * Creates a storage buffer\n * @param data the data for the storage buffer or the size of the buffer\n * @param creationFlags flags to use when creating the buffer (see Constants.BUFFER_CREATIONFLAG_XXX). The BUFFER_CREATIONFLAG_STORAGE flag will be automatically added\n * @param label defines the label of the buffer (for debug purpose)\n * @returns the new buffer\n */\n createStorageBuffer(data, creationFlags, label) {\n return this._createBuffer(data, creationFlags | Constants.BUFFER_CREATIONFLAG_STORAGE, label);\n }\n /**\n * Updates a storage buffer\n * @param buffer the storage buffer to update\n * @param data the data used to update the storage buffer\n * @param byteOffset the byte offset of the data\n * @param byteLength the byte length of the data\n */\n updateStorageBuffer(buffer, data, byteOffset, byteLength) {\n const dataBuffer = buffer;\n if (byteOffset === undefined) {\n byteOffset = 0;\n }\n let view;\n if (byteLength === undefined) {\n if (data instanceof Array) {\n view = new Float32Array(data);\n }\n else if (data instanceof ArrayBuffer) {\n view = new Uint8Array(data);\n }\n else {\n view = data;\n }\n byteLength = view.byteLength;\n }\n else {\n if (data instanceof Array) {\n view = new Float32Array(data);\n }\n else if (data instanceof ArrayBuffer) {\n view = new Uint8Array(data);\n }\n else {\n view = data;\n }\n }\n this._bufferManager.setSubData(dataBuffer, byteOffset, view, 0, byteLength);\n }\n _readFromGPUBuffer(gpuBuffer, size, buffer, noDelay) {\n return new Promise((resolve, reject) => {\n const readFromBuffer = () => {\n gpuBuffer.mapAsync(1 /* WebGPUConstants.MapMode.Read */, 0, size).then(() => {\n const copyArrayBuffer = gpuBuffer.getMappedRange(0, size);\n let data = buffer;\n if (data === undefined) {\n data = new Uint8Array(size);\n data.set(new Uint8Array(copyArrayBuffer));\n }\n else {\n const ctor = data.constructor; // we want to create result data with the same type as buffer (Uint8Array, Float32Array, ...)\n data = new ctor(data.buffer);\n data.set(new ctor(copyArrayBuffer));\n }\n gpuBuffer.unmap();\n this._bufferManager.releaseBuffer(gpuBuffer);\n resolve(data);\n }, (reason) => {\n if (this.isDisposed) {\n resolve(new Uint8Array());\n }\n else {\n reject(reason);\n }\n });\n };\n if (noDelay) {\n this.flushFramebuffer();\n readFromBuffer();\n }\n else {\n // we are using onEndFrameObservable because we need to map the gpuBuffer AFTER the command buffers\n // have been submitted, else we get the error: \"Buffer used in a submit while mapped\"\n this.onEndFrameObservable.addOnce(() => {\n readFromBuffer();\n });\n }\n });\n }\n /**\n * Read data from a storage buffer\n * @param storageBuffer The storage buffer to read from\n * @param offset The offset in the storage buffer to start reading from (default: 0)\n * @param size The number of bytes to read from the storage buffer (default: capacity of the buffer)\n * @param buffer The buffer to write the data we have read from the storage buffer to (optional)\n * @param noDelay If true, a call to flushFramebuffer will be issued so that the data can be read back immediately and not in engine.onEndFrameObservable. This can speed up data retrieval, at the cost of a small perf penalty (default: false).\n * @returns If not undefined, returns the (promise) buffer (as provided by the 4th parameter) filled with the data, else it returns a (promise) Uint8Array with the data read from the storage buffer\n */\n readFromStorageBuffer(storageBuffer, offset, size, buffer, noDelay) {\n size = size || storageBuffer.capacity;\n const gpuBuffer = this._bufferManager.createRawBuffer(size, WebGPUConstants.BufferUsage.MapRead | WebGPUConstants.BufferUsage.CopyDst, undefined, \"TempReadFromStorageBuffer\");\n this._renderEncoder.copyBufferToBuffer(storageBuffer.underlyingResource, offset ?? 0, gpuBuffer, 0, size);\n return this._readFromGPUBuffer(gpuBuffer, size, buffer, noDelay);\n }\n /**\n * Read data from multiple storage buffers\n * @param storageBuffers The list of storage buffers to read from\n * @param offset The offset in the storage buffer to start reading from (default: 0). This is the same offset for all storage buffers!\n * @param size The number of bytes to read from each storage buffer (default: capacity of the first buffer)\n * @param buffer The buffer to write the data we have read from the storage buffers to (optional). If provided, the buffer should be large enough to hold the data from all storage buffers!\n * @param noDelay If true, a call to flushFramebuffer will be issued so that the data can be read back immediately and not in engine.onEndFrameObservable. This can speed up data retrieval, at the cost of a small perf penalty (default: false).\n * @returns If not undefined, returns the (promise) buffer (as provided by the 4th parameter) filled with the data, else it returns a (promise) Uint8Array with the data read from the storage buffer\n */\n readFromMultipleStorageBuffers(storageBuffers, offset, size, buffer, noDelay) {\n size = size || storageBuffers[0].capacity;\n const gpuBuffer = this._bufferManager.createRawBuffer(size * storageBuffers.length, WebGPUConstants.BufferUsage.MapRead | WebGPUConstants.BufferUsage.CopyDst, undefined, \"TempReadFromMultipleStorageBuffers\");\n for (let i = 0; i < storageBuffers.length; i++) {\n this._renderEncoder.copyBufferToBuffer(storageBuffers[i].underlyingResource, offset ?? 0, gpuBuffer, i * size, size);\n }\n return this._readFromGPUBuffer(gpuBuffer, size * storageBuffers.length, buffer, noDelay);\n }\n /**\n * Sets a storage buffer in the shader\n * @param name Defines the name of the storage buffer as defined in the shader\n * @param buffer Defines the value to give to the uniform\n */\n setStorageBuffer(name, buffer) {\n this._currentDrawContext?.setBuffer(name, buffer?.getBuffer() ?? null);\n }\n}\n// Default glslang options.\nWebGPUEngine._GlslangDefaultOptions = {\n jsPath: `${Tools._DefaultCdnUrl}/glslang/glslang.js`,\n wasmPath: `${Tools._DefaultCdnUrl}/glslang/glslang.wasm`,\n};\nWebGPUEngine._InstanceId = 0;\n//# sourceMappingURL=webgpuEngine.js.map"],"names":["WebGPUTextureHelper","ComputeNumMipmapLevels","width","height","ILog2","Math","max","GetTextureTypeFromFormat","format","Constants","TEXTURETYPE_UNSIGNED_BYTE","TEXTURETYPE_BYTE","TEXTURETYPE_UNSIGNED_SHORT","TEXTURETYPE_SHORT","TEXTURETYPE_HALF_FLOAT","TEXTURETYPE_UNSIGNED_INTEGER","TEXTURETYPE_FLOAT","GetBlockInformationFromFormat","length","IsHardwareTexture","texture","release","IsInternalTexture","dispose","IsImageBitmap","imageBitmap","undefined","close","IsImageBitmapArray","Array","isArray","IsCompressedFormat","GetWebGPUTextureFormat","type","useSRGBBuffer","TEXTUREFORMAT_DEPTH16","TEXTUREFORMAT_DEPTH24","TEXTUREFORMAT_DEPTH24_STENCIL8","TEXTUREFORMAT_DEPTH32_FLOAT","TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8","TEXTUREFORMAT_STENCIL8","TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM","TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT","TEXTUREFORMAT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT","TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5","TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3","TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1","TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1","TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4","TEXTUREFORMAT_COMPRESSED_RGB_ETC1_WEBGL","TEXTUREFORMAT_COMPRESSED_RGB8_ETC2","TEXTUREFORMAT_COMPRESSED_RGBA8_ETC2_EAC","TEXTUREFORMAT_RED","TEXTUREFORMAT_RG","TEXTUREFORMAT_RGB","TEXTUREFORMAT_RED_INTEGER","TEXTUREFORMAT_RG_INTEGER","TEXTUREFORMAT_RGB_INTEGER","TEXTUREFORMAT_RGBA_INTEGER","TEXTUREFORMAT_RGBA","TEXTUREFORMAT_BGRA","TEXTUREFORMAT_ALPHA","TEXTUREFORMAT_LUMINANCE","TEXTUREFORMAT_LUMINANCE_ALPHA","TEXTURETYPE_INT","TEXTURETYPE_UNSIGNED_SHORT_5_6_5","TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV","TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV","TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4","TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1","TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV","GetNumChannelsFromWebGPUTextureFormat","HasStencilAspect","HasDepthAndStencilAspects","GetDepthFormatOnly","GetSample","sampleCount","WebGPUPerfCounter","constructor","this","_gpuTimeInFrameId","counter","PerfCounter","_addDuration","currentFrameId","duration","_fetchResult","fetchNewFrame","addCount","ThinWebGPUEngine","AbstractEngine","super","arguments","dbgShowShaderCode","dbgSanityChecks","dbgVerboseLogsNumFrames","dbgLogIfNotDrawWrapper","dbgShowEmptyEnableEffectCalls","dbgVerboseLogsForFirstFrames","_currentRenderPass","_snapshotRenderingMode","SNAPSHOTRENDERING_STANDARD","_timestampIndex","_debugStackRenderPass","enableGPUTimingMeasurements","_timestampQuery","enable","gpuTimeInFrameForMainPass","_currentPassIsMainPass","_currentRenderTarget","_endCurrentRenderPass","i","popDebugGroup","currentPassIndex","_snapshotRendering","endRenderPass","compatibilityMode","_bundleList","run","reset","end","endPass","gpuTimeInFrame","_count","Logger","Log","uniqueId","_debugPopGroup","_generateMipmaps","commandEncoder","_renderEncoder","gpuHardwareTexture","_hardwareTexture","mipmapCount","isCube","_textureHelper","generateCubeMipmaps","generateMipmaps","is3D","PowerPreference","FeatureName","BufferMapState","BufferUsage","MapMode","TextureDimension","TextureUsage","TextureViewDimension","TextureAspect","TextureFormat","AddressMode","FilterMode","MipmapFilterMode","CompareFunction","ShaderStage","BufferBindingType","SamplerBindingType","TextureSampleType","StorageTextureAccess","CompilationMessageType","PipelineErrorReason","AutoLayoutMode","PrimitiveTopology","FrontFace","CullMode","ColorWrite","BlendFactor","BlendOperation","StencilOperation","IndexFormat","VertexFormat","VertexStepMode","ComputePassTimestampLocation","RenderPassTimestampLocation","LoadOp","StoreOp","QueryType","CanvasAlphaMode","CanvasToneMappingMode","DeviceLostReason","ErrorFilter","WebGPUShaderProcessor","shaderLanguage","_addUniformToLeftOverUBO","name","uniformType","preProcessors","_getArraySize","_webgpuProcessingContext","leftOverUniforms","push","_buildLeftOverUBO","LeftOvertUBOName","availableUBO","availableBuffers","binding","getNextFreeUBOBinding","_addBufferBindingDescription","_generateLeftOverUBOCode","_collectBindingNames","bindGroupLayoutEntries","setDefinition","j","entry","bindGroupLayoutEntryInfo","nameInArrayOfTexture","externalTexture","storageTexture","textureNames","sampler","samplerNames","buffer","bufferNames","_preCreateBindGroupEntries","bindGroupEntries","entries","resource","offset","size","_addTextureBindingDescription","textureInfo","textureIndex","dimension","isVertex","groupIndex","bindingIndex","textures","len","visibility","access","viewDimension","sampleType","multisampled","textureName","isTextureArray","index","_addSamplerBindingDescription","samplerInfo","uniformBufferInfo","bufferType","InternalsUBOName","UniformSizes","bool","int","float","vec2","ivec2","uvec2","vec3","ivec3","uvec3","vec4","ivec4","uvec4","mat2","mat3","mat4","i32","u32","f32","mat2x2","mat3x3","mat4x4","mat2x2f","mat3x3f","mat4x4f","vec2i","vec3i","vec4i","vec2u","vec3u","vec4u","vec2f","vec3f","vec4f","vec2h","vec3h","vec4h","_SamplerFunctionByWebGLSamplerType","sampler2D","sampler2DArray","sampler2DShadow","sampler2DArrayShadow","samplerCube","sampler3D","_TextureTypeByWebGLSamplerType","samplerCubeArray","_GpuTextureViewDimensionByWebGPUTextureType","textureCube","textureCubeArray","texture2D","texture2DArray","texture3D","_SamplerTypeByWebGLSamplerType","_IsComparisonSamplerByWebGPUSamplerType","samplerShadow","samplerArrayShadow","WebGPUPipelineContext","isAsync","isReady","stages","shaderProcessingContext","engine","bindGroupLayouts","_name","_leftOverUniformsByName","vertexBufferKindToType","_handlesSpectorRebuildCallback","_fillEffectInformation","effect","uniformBuffersNames","uniformsNames","uniforms","samplerList","samplers","attributesNames","attributes","_doNotHandleContextLost","_fragmentSourceCode","_vertexSourceCode","foundSamplers","availableTextures","splice","attr","getAttributes","buildUniformLayout","attributeNamesFromEffect","attributeLocationsFromEffect","location","uniformBuffer","UniformBuffer","leftOverUniform","replace","addUniform","create","setEngine","setInt","uniformName","value","updateInt","setInt2","x","y","updateInt2","setInt3","z","updateInt3","setInt4","w","updateInt4","setIntArray","array","updateIntArray","setIntArray2","setIntArray3","setIntArray4","setUInt","updateUInt","setUInt2","updateUInt2","setUInt3","updateUInt3","setUInt4","updateUInt4","setUIntArray","updateUIntArray","setUIntArray2","setUIntArray3","setUIntArray4","setArray","updateArray","setArray2","setArray3","setArray4","setMatrices","matrices","updateMatrices","setMatrix","matrix","updateMatrix","setMatrix3x3","updateMatrix3x3","setMatrix2x2","updateMatrix2x2","setFloat","updateFloat","setVector2","vector2","setFloat2","updateFloat2","setVector3","vector3","setFloat3","updateFloat3","setVector4","vector4","setFloat4","setQuaternion","quaternion","updateFloat4","setColor3","color3","r","g","b","setColor4","alpha","setDirectColor4","color4","a","_getVertexShaderCode","sources","vertex","_getFragmentShaderCode","fragment","_typeToLocationSize","WebGPUShaderProcessingContext","KnownUBOs","_SimplifiedKnownBindings","_SimplifiedKnownUBOs","_KnownUBOs","pureMode","vertexBufferKindToNumberOfComponents","_attributeNextLocation","_varyingNextLocation","freeGroupIndex","freeBindingIndex","availableVaryings","availableAttributes","availableSamplers","orderedAttributes","_findStartingGroupBinding","knownUBOs","groups","getAttributeNextLocation","dataType","arrayLength","getVaryingNextLocation","_getNextFreeBinding","bindingCount","returnValue","ExtractBetweenMarkers","markerOpen","markerClose","block","startIndex","currPos","openMarkers","waitForChar","currChar","charAt","nextChar","SkipWhitespaces","s","c","IsIdentifierChar","v","charCodeAt","RemoveComments","inComments","join","FindBackward","c2","InjectStartingAndEndingCode","code","mainFuncDecl","startingCode","endingCode","idx","indexOf","part1","substring","part2","lastClosingCurly","lastIndexOf","Scene","Light0","Light1","Light2","Light3","Light4","Light5","Light6","Light7","Light8","Light9","Light10","Light11","Light12","Light13","Light14","Light15","Light16","Light17","Light18","Light19","Light20","Light21","Light22","Light23","Light24","Light25","Light26","Light27","Light28","Light29","Light30","Light31","Material","Mesh","Internals","WebGPUShaderProcessorGLSL","_missingVaryings","_textureArrayProcessing","_vertexIsGLES3","_fragmentIsGLES3","parseGLES3","startArray","endArray","lengthInString","isNaN","trim","initializeShaders","processingContext","attributeKeywordName","varyingVertexKeywordName","varyingFragmentKeywordName","preProcessShaderCode","isFragment","ubDeclaration","alreadyInjected","varyingCheck","varying","test","varyingProcessor","_preProcessors","match","exec","interpolationQualifier","varyingType","Warn","attributeProcessor","attribute","attributeType","numComponents","newType","newName","uniformProcessor","uniform","arraySize","autoBindSampler","isStorageTexture","samplerType","isComparisonSampler","samplerBindingType","samplerName","AUTOSAMPLERSUFFIX","componentType","samplerGroupIndex","samplerBindingIndex","samplerFunction","textureType","textureDimension","layouts","textureSetIndex","textureBindingIndex","uniformBufferProcessor","knownUBO","postProcessor","defines","_processingContext","_parameters","hasDrawBuffersExtension","search","hasFragCoord","fragCoordCode","injectCode","hasOutput","_applyTextureArrayProcessing","regex","RegExp","iindex","uniformBufferDescription","ubo","finalizeShaders","vertexCode","fragmentCode","decl","leftOverUBO","builtInName_frag_depth","gpuTextureViewDimensionByWebGPUTextureFunction","texture_1d","texture_2d","texture_2d_array","texture_3d","texture_cube","texture_cube_array","texture_multisampled_2d","texture_depth_2d","texture_depth_2d_array","texture_depth_cube","texture_depth_cube_array","texture_depth_multisampled_2d","texture_storage_1d","texture_storage_2d","texture_storage_2d_array","texture_storage_3d","texture_external","WebGPUShaderProcessorWGSL","uniformRegexp","textureRegexp","noPrecision","preProcessor","key","parseInt","parseFloat","_attributesInputWGSL","_attributesWGSL","_attributesConversionCodeWGSL","_hasNonFloatAttribute","_varyingsWGSL","_varyingNamesWGSL","_stridedUniformArrays","interpolationType","interpolationSampling","interpolation","textureProcessor","isArrayOfTexture","textureFunc","storageTextureFormat","isDepthTexture","definePattern","_processSamplers","_processCustomBuffers","_processStridedUniformArrays","vertexInputs","vertexOutputs","vertexMainStartingCode","vertexMainEndingCode","needDiagnosticOff","DISABLEUA","fragmentInputs","fragmentOutputs","regexRoot","indexLocation","hasFragDepth","saveIndex","fragmentStartingCode","stridedArrays","stridedArrayType","samplerRegexp","suffixLessLength","insertPart","lastIndex","instantiateBufferRegexp","decoration","structName","bufferInfo","uniformArrayName","WebGPUHardwareTexture","underlyingResource","_webgpuTexture","getMSAATexture","_webgpuMSAATexture","setMSAATexture","releaseMSAATexture","_engine","releaseTexture","existingTexture","_originalFormatIsRGB","textureUsages","textureAdditionalUsages","view","viewForWriting","set","hardwareTexture","setUsage","_textureSource","generateMipMaps","is2DArray","depth","arrayLayerCount","aspect","createView","label","mipLevelCount","baseArrayLayer","baseMipLevel","descriptor","createViewForWriting","saveNumMipMaps","destroy","_copyInvertYTempTexture","invertYPreMultiplyAlphaVertexSource","invertYPreMultiplyAlphaWithOfstVertexSource","PipelineType","VideoPipelineType","shadersForPipelineType","renderableTextureFormatToIndex","r8unorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8uint","rg8sint","r32uint","r32sint","r32float","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8uint","rgba8sint","bgra8unorm","rgb10a2uint","rgb10a2unorm","rg32uint","rg32sint","rg32float","rgba16uint","rgba16sint","rgba16float","rgba32uint","rgba32sint","rgba32float","stencil8","depth16unorm","depth24plus","depth32float","r16unorm","rg16unorm","rgba16unorm","r16snorm","rg16snorm","rgba16snorm","WebGPUTextureManager","device","bufferManager","enabledExtensions","_pipelines","_compiledShaders","_videoPipelines","_videoCompiledShaders","_deferredReleaseTextures","_device","_bufferManager","keys","Object","_mipmapSampler","createSampler","minFilter","_videoSampler","_ubCopyWithOfst","createBuffer","WebGPUConstants.BufferUsage","Uniform","CopyDst","_getPipeline","_getVideoPipeline","MipMap","params","InvertYPremultiplyAlpha","invertY","premultiplyAlpha","Clear","InvertYPremultiplyAlphaWithOfst","pipelineAndBGL","modules","processorOptions","split","indexParameters","shouldUseHighPrecisionShader","processor","_getShaderProcessor","supportsUniformBuffers","shadersRepository","includesShadersStore","version","toString","platformName","shaderPlatformName","_getShaderProcessingContext","isNDCHalfZRange","useReverseDepthBuffer","Initialize","Process","migratedVertexCode","migratedFragmentCode","final","Finalize","vertexModule","createShaderModule","fragmentModule","pipeline","createRenderPipeline","layout","module","entryPoint","targets","primitive","topology","stripIndexFormat","getBindGroupLayout","DontInvertY","InvertY","setCommandEncoder","encoder","_commandEncoderForCreation","copyVideoToTexture","video","useOwnCommandEncoder","bindGroupLayout","createCommandEncoder","pushDebugGroup","webgpuHardwareTexture","renderPassDescriptor","colorAttachments","loadOp","storeOp","passEncoder","beginRenderPass","importExternalTexture","source","bindGroup","createBindGroup","setPipeline","setBindGroup","draw","queue","submit","finish","invertYPreMultiplyAlpha","gpuOrHdwTexture","faceIndex","mipLevel","layers","ofstX","ofstY","rectWidth","rectHeight","allowGPUOptimization","useRect","gpuTexture","setRawData","Float32Array","outputTexture","createTexture","_copyInvertYRenderPassDescr","_copyInvertYBindGroupWithOfst","_copyInvertYBindGroup","copyTextureToTexture","origin","depthOrArrayLayers","copyWithInvertY","srcTextureView","hasMipmaps","usage","additionalUsages","layerCount","textureSize","renderAttachmentFlag","isCompressedFormat","usages","updateTexture","createCubeTexture","imageBitmaps","updateCubeTextures","f","_mipmapGenRenderPassDescr","_mipmapGenBindGroup","createGPUTextureForInternalTexture","creationFlags","dontCreateMSAATexture","gpuTextureWrapper","TEXTURE_CREATIONFLAG_STORAGE","_useSRGBBuffer","_source","hasMipMaps","_maxLodLevel","baseWidth","baseHeight","baseDepth","createMSAATexture","samples","releaseExisting","gpuMSAATexture","offsetX","offsetY","faces","blockInformation","textureCopyView","premultipliedAlpha","textureExtent","ceil","byteLength","bytesPerRow","createRawBuffer","MapWrite","CopySrc","arrayBuffer","getMappedRange","Uint8Array","unmap","copyBufferToTexture","rowsPerImage","releaseBuffer","writeTexture","dontUseRect","copyExternalImageToTexture","srcTexture","readPixels","noDataConversion","bytesPerRowAligned","gpuBuffer","MapRead","copyTextureToBuffer","readDataFromBuffer","irradianceTexture","_irradianceTexture","destroyDeferredTextures","WebGPUDataBuffer","DataBuffer","_buffer","capacity","engineId","WebGPUBufferManager","_IsGPUBuffer","_FlagsToString","flags","suffix","result","_deferredReleaseBuffers","viewOrSize","mappedAtCreation","alignedLength","verticesBufferDescriptor","isView","dataBuffer","labelId","references","setSubData","dstByteOffset","src","srcByteOffset","writeBuffer","min","chunkStart","byteOffset","chunkEnd","tempView","slice","maxChunk","_getHalfFloatAsFloatRGBAArrayBuffer","dataLength","destArray","srcData","Uint16Array","FromHalfFloat","destroyBuffer","floatFormat","Promise","resolve","reject","mapAsync","then","copyArrayBuffer","data","allocateAndCopyTypedBuffer","data2","offset2","reason","isDisposed","destroyDeferredBuffers","filterToBits","comparisonFunctionToBits","filterNoMipToBits","WebGPUCacheSampler","_samplers","disabled","GetSamplerHashCode","anisotropy","_cachedAnisotropicFilteringLevel","samplingMode","_comparisonFunction","_cachedWrapU","_cachedWrapV","_cachedWrapR","useMipMaps","_GetSamplerFilterDescriptor","magFilter","mipmapFilter","lodMinClamp","lodMaxClamp","TEXTURE_LINEAR_LINEAR_MIPNEAREST","TEXTURE_LINEAR_LINEAR_MIPLINEAR","TEXTURE_TRILINEAR_SAMPLINGMODE","TEXTURE_NEAREST_NEAREST_MIPLINEAR","TEXTURE_NEAREST_NEAREST_MIPNEAREST","TEXTURE_NEAREST_LINEAR_MIPNEAREST","TEXTURE_NEAREST_LINEAR_MIPLINEAR","TEXTURE_NEAREST_LINEAR","TEXTURE_NEAREST_NEAREST","TEXTURE_NEAREST_SAMPLINGMODE","TEXTURE_LINEAR_NEAREST_MIPNEAREST","TEXTURE_LINEAR_NEAREST_MIPLINEAR","TEXTURE_LINEAR_LINEAR","TEXTURE_BILINEAR_SAMPLINGMODE","TEXTURE_LINEAR_NEAREST","anisotropyEnabled","_GetWrappingMode","mode","TEXTURE_WRAP_ADDRESSMODE","TEXTURE_CLAMP_ADDRESSMODE","TEXTURE_MIRROR_ADDRESSMODE","_GetSamplerWrappingDescriptor","addressModeU","addressModeV","addressModeW","_GetSamplerDescriptor","filterDescriptor","compare","GetCompareFunction","maxAnisotropy","compareFunction","ALWAYS","EQUAL","GREATER","GEQUAL","LESS","LEQUAL","NEVER","NOTEQUAL","getSampler","bypassCache","hash","gpuSampler","vertexBufferKindForNonFloatProcessing","VertexBuffer","PositionKind","NormalKind","TangentKind","UVKind","UV2Kind","UV3Kind","UV4Kind","UV5Kind","UV6Kind","ColorKind","ColorInstanceKind","MatricesIndicesKind","MatricesWeightsKind","MatricesIndicesExtraKind","MatricesWeightsExtraKind","isSignedType","BYTE","SHORT","INT","FLOAT","UNSIGNED_BYTE","UNSIGNED_SHORT","UNSIGNED_INT","Error","StatePosition","alphaBlendFactorToIndex","stencilOpToIndex","WebGPUCacheRenderPipeline","emptyVertexBuffer","mrtTextureCount","_useTextureStage","_states","_statesLength","_stateDirtyLowestIndex","_emptyVertexBuffer","_mrtFormats","_parameter","token","vertexBuffers","_kMaxVertexBufferStride","limits","maxVertexBufferArrayStride","_isDirty","setAlphaToCoverage","resetDepthCullingState","setClampDepth","setDepthBias","_webgpuColorFormat","setColorFormat","setMRT","setAlphaBlendEnabled","setAlphaBlendFactors","setWriteMask","setDepthStencilFormat","setStencilEnabled","resetStencilState","setBuffers","_setTextureState","colorFormats","_mrtAttachments1","getRenderPipeline","fillMode","textureState","_GetTopology","_setVertexState","_createRenderPipeline","NumCacheMiss","_NumPipelineCreationCurrentFrame","_setShaderStage","_setRasterizationState","_setColorStates","_setDepthStencilState","lastStateDirtyLowestIndex","NumCacheHitWithoutHash","_getRenderPipeline","NumCacheHitWithHash","_setRenderPipeline","endFrame","NumPipelineCreationLastFrame","enabled","_alphaToCoverageEnabled","setFrontFace","frontFace","_frontFace","setCullEnabled","_cullEnabled","setCullFace","cullFace","_cullFace","clampDepth","_clampDepth","setDepthCullingState","cullEnabled","zOffset","zOffsetUnits","depthTestEnabled","depthWriteEnabled","depthCompare","_depthWriteEnabled","_depthTestEnabled","_depthCompare","setDepthBiasSlopeScale","depthBias","_depthBias","DepthBias","depthBiasSlopeScale","_depthBiasSlopeScale","DepthBiasSlopeScale","_colorFormat","setMRTAttachments","attachments","mrtAttachments","mask","_mrtEnabledMask","MRTAttachments1","textureArray","textureCount","mrtTextureArray","bits","indexBits","numRT","gpuWrapper","_mrtAttachments2","MRTAttachments2","_alphaBlendEnabled","factors","operations","_alphaBlendFuncParams","_alphaBlendEqParams","_writeMask","_webgpuDepthStencilFormat","_depthStencilFormat","setDepthTestEnabled","setDepthWriteEnabled","setDepthCompare","func","_stencilEnabled","setStencilCompare","_stencilFrontCompare","setStencilDepthFailOp","op","_stencilFrontDepthFailOp","setStencilPassOp","_stencilFrontPassOp","setStencilFailOp","_stencilFrontFailOp","setStencilReadMask","_stencilReadMask","StencilReadMask","setStencilWriteMask","_stencilWriteMask","StencilWriteMask","setStencilState","KEEP","REPLACE","stencilEnabled","depthFailOp","passOp","failOp","readMask","writeMask","indexBuffer","overrideVertexBuffers","_vertexBuffers","_overrideVertexBuffers","_indexBuffer","MATERIAL_TriangleFillMode","MATERIAL_PointFillMode","MATERIAL_WireFrameFillMode","MATERIAL_PointListDrawMode","MATERIAL_LineListDrawMode","MATERIAL_LineLoopDrawMode","MATERIAL_LineStripDrawMode","MATERIAL_TriangleStripDrawMode","MATERIAL_TriangleFanDrawMode","_GetAphaBlendOperation","operation","GL_ALPHA_EQUATION_ADD","GL_ALPHA_EQUATION_SUBTRACT","GL_ALPHA_EQUATION_REVERSE_SUBTRACT","GL_ALPHA_EQUATION_MIN","GL_ALPHA_EQUATION_MAX","_GetAphaBlendFactor","factor","GL_ALPHA_FUNCTION_SRC","GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR","GL_ALPHA_FUNCTION_SRC_ALPHA","GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA","GL_ALPHA_FUNCTION_DST_ALPHA","GL_ALPHA_FUNCTION_ONE_MINUS_DST_ALPHA","GL_ALPHA_FUNCTION_DST_COLOR","GL_ALPHA_FUNCTION_ONE_MINUS_DST_COLOR","GL_ALPHA_FUNCTION_SRC_ALPHA_SATURATED","GL_ALPHA_FUNCTION_CONSTANT_COLOR","GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_COLOR","GL_ALPHA_FUNCTION_CONSTANT_ALPHA","GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_ALPHA","GL_ALPHA_FUNCTION_SRC1_COLOR","GL_ALPHA_FUNCTION_ONE_MINUS_SRC1_COLOR","GL_ALPHA_FUNCTION_SRC1_ALPHA","GL_ALPHA_FUNCTION_ONE_MINUS_SRC1_ALPHA","_GetCompareFunction","_GetStencilOpFunction","_GetVertexInputDescriptorFormat","vertexBuffer","normalized","getSize","getKind","_getAphaBlendState","srcFactor","dstFactor","_getColorBlendState","id","_shaderId","rasterizationState","_rasterizationState","RasterizationState","colorStates","_colorStates","ColorStates","stencilState","depthStencilState","_depthStencilState","DepthStencilState","currStateLen","newNumStates","VertexState","webgpuPipelineContext","_pipelineContext","locations","currentGPUBuffer","numVertexBuffers","effectiveBuffer","_validOffsetRange","effectiveByteOffset","formatSize","byteStride","effectiveByteStride","vid","hashCode","_textureState","TextureStage","_createPipelineLayout","_createPipelineLayoutWithTextureStage","createBindGroupLayout","createPipelineLayout","bitVal","_getVertexInputDescriptor","descriptors","currentGPUAttributes","invalidOffsetRange","vertexBufferDescriptor","arrayStride","stepMode","getIsInstanced","shaderLocation","inputStateDescriptor","pipelineLayout","alphaBlend","colorBlend","getEngine","pipelineContext","kind","currentVertexBuffer","currentVertexBufferType","vertexBufferType","DeduceStride","parallelShaderCompile","_caps","_processShaderCodeAsync","_features","_checkNonFloatVertexBuffersDontRecreatePipelineContext","checkNonFloatVertexBuffers","descr","blend","color","stencilFrontBack","topologyIsTriangle","is32Bits","depthStencilFormatHasStencil","vertexStage","buffers","cullMode","fragmentStage","multisample","count","depthStencil","stencilFront","stencilBack","stencilReadMask","stencilWriteMask","depthBiasClamp","_depthBiasClamp","NodeState","values","countNode","countPipeline","node","childCountNodes","childCoundPipeline","WebGPUCacheRenderPipelineTree","GetNodeCounts","counts","_Cache","nodeCount","pipelineCount","_GetPipelines","pipelines","curPath","curPathLen","path","nnode","GetPipelines","ResetCache","_nodeStack","param","nn","WebGPUStencilStateComposer","StencilStateComposer","cache","_cache","_func","funcMask","_funcMask","opStencilFail","_opStencilFail","opDepthFail","_opDepthFail","opStencilDepthPass","_opStencilDepthPass","_mask","_enabled","apply","stencilMaterialEnabled","stencilMaterial","stencilGlobal","funcRef","WebGPUDepthCullingState","DepthCullingState","_zOffset","_isZOffsetDirty","_zOffsetUnits","_isCullFaceDirty","cull","_cull","_isCullDirty","depthFunc","_depthFunc","_isDepthFuncDirty","depthMask","_depthMask","_isDepthMaskDirty","depthTest","_depthTest","_isDepthTestDirty","_isFrontFaceDirty","ExternalTexture","IsExternalTexture","getClassName","_video","TEXTURETYPE_UNDEFINED","TEXTUREFORMAT_UNDEFINED","InternalTexture","_Counter","readyState","HAVE_CURRENT_DATA","WebGPUMaterialContext","forceBindGroupCreation","_numExternalTextures","hasFloatOrDepthTextures","_numFloatOrDepthTextures","updateId","isDirty","setSampler","samplerCache","currentHashCode","setTexture","textureCache","currentTextureId","isFloatOrDepthTexture","isExternalTexture","WebGPUDrawContext","materialContextUpdateId","_materialContextUpdateId","resetIsDirty","useInstancing","_useInstancing","use","indirectDrawBuffer","Indirect","Storage","_indirectDrawData","Uint32Array","_currentInstanceCount","fastBundle","bindGroups","setBuffer","setIndirectData","indexOrVertexCount","instanceCount","firstIndexOrVertex","textureIdStart","WebGPUBindGroupCacheNode","WebGPUCacheBindGroups","Statistics","totalCreated","NumBindGroupsCreatedTotal","lastFrameCreated","NumBindGroupsCreatedLastFrame","lookupLastFrame","NumBindGroupsLookupLastFrame","noLookupLastFrame","NumBindGroupsNoLookupLastFrame","_NumBindGroupsCreatedCurrentFrame","_NumBindGroupsLookupCurrentFrame","_NumBindGroupsNoLookupCurrentFrame","cacheSampler","_cacheSampler","getBindGroups","drawContext","materialContext","cacheIsDisabled","bufferName","uboId","nextNode","samplerHashCode","textureId","entryInfo","bindingInfo","JSON","stringify","webgpuBuffer","groupLayout","ShaderStore","ShadersStoreWGSL","WebGPUClearQuad","_depthTextureFormat","_cacheRenderPipeline","_bindGroups","_bundleCache","_keyTemp","_effect","createEffect","clear","renderPass","clearColor","clearDepth","clearStencil","renderPass2","bundleKey","bundle","isRTTPass","depthStencilFormatIndex","createRenderBundleEncoder","depthStencilFormat","_clearReverseDepthValue","_clearDepthValue","update","bufferInternals","_ubInvertY","_ubDontInvertY","bufferLeftOver","getBuffer","WebGPURenderItemViewport","h","floor","setViewport","clone","WebGPURenderItemScissor","setScissorRect","WebGPURenderItemStencilRef","ref","setStencilReference","WebGPURenderItemBlendColor","setBlendConstant","WebGPURenderItemBeginOcclusionQuery","query","beginOcclusionQuery","WebGPURenderItemEndOcclusionQuery","endOcclusionQuery","WebGPURenderItemBundles","bundles","executeBundles","cloned","WebGPUBundleList","numDrawCalls","_list","_listLength","addBundle","_currentItemIsBundle","item","_currentBundleList","_finishBundle","_bundleEncoder","addItem","getBundleEncoder","WebGPUQuerySet","querySet","_querySet","canUseMultipleBuffers","_dstBuffers","_canUseMultipleBuffers","createQuerySet","_queryBuffer","QueryResolve","_getBuffer","firstQuery","queryCount","encoderResult","resolveQuerySet","copyBufferToBuffer","readValues","arrayBuf","BigUint64Array","err","readValue","Number","readTwoValuesAndSubtract","WebGPUTimestampQuery","gpuFrameTimeCounter","_gpuFrameTimeCounter","_measureDurationState","_measureDuration","WebGPUDurationMeasure","e","message","startFrame","start","stop","startPass","timestampWrites","gpuPerfCounter","frameId","stopPass","duration_","querySetLabel","writeTimestamp","beginningOfPassWriteIndex","endOfPassWriteIndex","WebGPUOcclusionQuery","hasQueries","_currentTotalIndices","_availableIndices","canBeginQuery","_frameQuerySetIsDirty","_queryFrameId","canBegin","_getCurrentRenderPassWrapper","occlusionQuerySet","startCount","incrementCount","_frameLastBuffer","_countIncrement","_allocateNewIndices","createQuery","deleteQuery","isQueryResultAvailable","_retrieveQueryBuffer","_lastBuffer","getQueryResult","numIndices","_delayQuerySetDispose","setTimeout","ShaderCodeInliner","_sourceCode","sourceCode","numMaxIterations","debug","_numMaxIterations","_functionDescr","inlineToken","processCode","_collectFunctions","_processInlining","inlineTokenIndex","funcParamsStartIndex","funcNameMatch","_RegexpFindFunctionNameAndType","funcType","funcName","funcParamsEndIndex","funcParams","funcBodyStartIndex","funcBodyEndIndex","funcBody","paramNames","p","parameters","body","callIndex","partBefore","partAfter","_replaceFunctionCallsByCode","doAgain","functionCallIndex","callParamsStartIndex","callParamsEndIndex","callParams","splitParameterCall","curIdx","startParamIdx","idx2","retParamName","_replaceNames","injectDeclarationIndex","partBetween","destinations","sourceLen","destination","args","WebGPUTintWASM","initTwgsl","twgslOptions","_Twgsl","_TWgslDefaultOptions","twgsl","jsPath","wasmPath","Tools","LoadBabylonScriptAsync","self","GetBabylonScriptURL","convertSpirV2WGSL","disableUniformityAnalysis","ccode","DisableUniformityAnalysis","ShowWGSLShaderCode","_DefaultCdnUrl","WebGPUSnapshotRendering","renderingMode","bundleList","_record","_play","_playBundleListIndex","_allBundleLists","_mode","play","record","activate","_modeSaved","currentRenderPass","SNAPSHOTRENDERING_FAST","_reportDrawCall","isLittleEndian","defineProperty","prototype","get","_alignedBuffer","enumerable","configurable","_rebuild","_ownsBuffer","_isDisposed","getWrapperBuffer","_alignBuffer","getData","forceVertexBufferStrideAndOffsetMultiple4Bytes","typeByteLength","GetTypeByteLength","alignedByteStride","alignedSize","totalVertices","_maxVerticesCount","totalLength","sourceData","alignedData","sourceDataAsFloat","DataView","ArrayBuffer","Int8Array","Int16Array","Int32Array","sourceOffset","getInt8","getUint8","getInt16","getUint16","getInt32","getUint32","getFloat32","Buffer","instanceDivisor","_label","WebGPUExternalTexture","_convertRGBtoRGBATextureData","rgbData","rgbaData","val1","newIndex","setAlphaMode","noDepthWriteChange","_alphaMode","ALPHA_DISABLE","_alphaState","depthCullingState","setDepthWrite","ALPHA_PREMULTIPLIED","setAlphaBlendFunctionParameters","ALPHA_PREMULTIPLIED_PORTERDUFF","ALPHA_COMBINE","ALPHA_ONEONE","ALPHA_ADD","ALPHA_SUBTRACT","ALPHA_MULTIPLY","ALPHA_MAXIMIZED","ALPHA_INTERPOLATE","ALPHA_SCREENMODE","ALPHA_ONEONE_ONEONE","ALPHA_ALPHATOCOLOR","ALPHA_REVERSEONEMINUS","ALPHA_SRC_DSTONEMINUSSRCALPHA","ALPHA_ONEONE_ONEZERO","ALPHA_EXCLUSION","ALPHA_LAYER_ACCUMULATE","_blendFunctionParameters","_blendEquationParameters","setAlphaEquation","equation","call","createRawTexture","compression","_compression","_creationFlags","_bufferView","updateRawTexture","_internalTexturesCache","bufferView","_uploadEncoder","createRawCubeTexture","textureFloatLinearFiltering","textureHalfFloatLinearFiltering","textureFloatRender","colorBufferFloat","_originalFormat","_bufferViewArray","updateRawCubeTexture","_format","needConversion","faceData","createRawCubeTextureFromUrl","url","scene","noMipmap","callback","mipmapGenerator","onLoad","onError","addPendingData","internalCallback","faceDataArrays","mipData","level","mipSize","allFaces","mipFaceData","removePendingData","_loadFile","offlineProvider","request","exception","status","statusText","createRawTexture3D","updateRawTexture3D","createRawTexture2DArray","updateRawTexture2DArray","_readTexturePixels","flushRenderer","flushFramebuffer","_readTexturePixelsSync","_createDepthStencilCubeTexture","options","internalTexture","generateStencil","internalOptions","bilinearFiltering","comparisonFunction","depthTextureFormat","_setupDepthStencilTexture","rootUrl","files","forcedExtension","createPolynomials","lodScale","lodOffset","fallback","loaderOptions","createCubeTextureBase","imgs","_setCubeMapTextureParams","onLoadedObservable","notifyObservers","loadMipmap","maxLevel","generateMipMapsForCubemap","WebGPURenderTargetWrapper","RenderTargetWrapper","isMulti","_createHardwareRenderTargetWrapper","rtWrapper","_renderTargetWrapperCache","createRenderTargetTexture","fullOptions","generateDepthBuffer","generateStencilBuffer","noColorAttachment","colorAttachment","_createInternalTexture","_samples","_generateDepthBuffer","_generateStencilBuffer","setTextures","createDepthStencilTexture","createMipMaps","_createDepthStencilTexture","wrapper","hasStencil","TEXTUREFORMAT_DEPTH24UNORM_STENCIL8","_depthStencilTextureWithStencil","GetTypeForDepthTexture","updateRenderTargetTextureSampleCount","getCaps","maxMSAASamples","_depthStencilTexture","setDepthStencilTexture","channel","depthStencilTexture","_setTexture","createRenderTargetCubeTexture","_OcclusionDataStorage","occlusionInternalRetryCounter","isOcclusionQueryInProgress","isOccluded","occlusionRetryCount","occlusionType","AbstractMesh","OCCLUSION_TYPE_NONE","occlusionQueryAlgorithmType","OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE","forceRenderingWhenOccluded","getGPUFrameTimeCounter","captureGPUFrameTime","algorithmType","_occlusionDataStorage","__occlusionDataStorage","_checkOcclusionQuery","dataStorage","supportOcclusionQuery","_occlusionQuery","occlusionQueryResult","OCCLUSION_TYPE_OPTIMISTIC","getScene","getBoundingBoxRenderer","occlusionBoundingBoxRenderer","renderOcclusionBoundingBox","timerQuery","viewDescriptorSwapChainAntialiasing","viewDescriptorSwapChain","tempColor4","Color4","WebGPUEngine","snapshotRenderingMode","snapshotRenderingReset","snapshotRendering","disableCacheSamplers","disable","disableCacheRenderPipelines","disableCacheBindGroups","_cacheBindGroups","areAllEffectsReady","getFontOffset","font","GetFontOffset","IsSupportedAsync","navigator","gpu","requestAdapter","adapter","catch","IsSupported","supportedExtensions","_adapterSupportedExtensions","_deviceEnabledExtensions","supportedLimits","_adapterSupportedLimits","currentLimits","_deviceLimits","description","getInfo","vendor","_adapterInfo","renderer","architecture","_compatibilityMode","currentSampleCount","_mainPassSampleCount","CreateAsync","canvas","initAsync","glslangOptions","antialias","_uploadEncoderDescriptor","_renderEncoderDescriptor","_clearStencilValue","_defaultSampleCount","_glslang","_tintWASM","_glslangAndTintAreFullyLoaded","_compiledComputeEffects","_counters","numEnableEffects","numEnableDrawWrapper","numBundleCreationNonCompatMode","numBundleReuseNonCompatMode","countersLastFrame","numMaxUncapturedErrors","scenes","_virtualScenes","_commandBuffers","_mainRenderPassWrapper","colorAttachmentViewDescriptor","depthAttachmentViewDescriptor","colorAttachmentGPUTextures","_rttRenderPassWrapper","_pendingDebugCommands","_currentOverrideVertexBuffers","_currentIndexBuffer","_colorWriteLocal","_forceEnableEffect","hasOriginBottomLeft","_workingGlslangAndTintPromise","_viewportsCurrent","_scissorsCurrent","_scissorCached","_stencilRefsCurrent","_blendColorsCurrent","_performanceMonitor","PerformanceMonitor","_drawCalls","deviceDescriptor","enableGPUDebugMarkers","Version","swapChainFormat","getPreferredCanvasFormat","_isWebGPU","_shaderPlatformName","_renderingCanvas","_options","userAgent","_setupMobileChecks","_sharedInit","_shaderProcessor","_shaderProcessorWGSL","prepareGlslangAndTintAsync","_initGlslang","_glslangOptions","glslang","_twgslOptions","_InstanceId","_adapter","features","forEach","feature","info","requiredFeatures","enableAllFeatures","requestedExtensions","validExtensions","extension","setMaximumLimits","requiredLimits","requestDevice","numUncapturedErrors","addEventListener","event","error","lost","_contextWasLost","onContextLostObservable","_restoreEngineAfterContextLost","async","_initializeLimits","stride","_depthCullingState","_stencilStateComposer","_stencilState","_clearQuad","_defaultDrawContext","createDrawContext","_currentDrawContext","_defaultMaterialContext","createMaterialContext","_currentMaterialContext","_initializeContextAndSwapChain","_initializeMainAttachments","resize","_GlslangDefaultOptions","maxTexturesImageUnits","maxSampledTexturesPerShaderStage","maxVertexTextureImageUnits","maxCombinedTexturesImageUnits","maxTextureSize","maxTextureDimension2D","maxCubemapTextureSize","maxRenderTextureSize","maxVertexAttribs","maxVertexAttributes","maxDrawBuffers","maxVaryingVectors","maxInterStageShaderVariables","maxFragmentUniformVectors","maxUniformBufferBindingSize","maxVertexUniformVectors","standardDerivatives","astc","s3tc","pvrtc","etc1","etc2","bptc","uintIndices","fragmentDepthSupported","highPrecisionShaderSupported","supportFloatTexturesResolve","rg11b10ufColorRenderable","textureFloat","textureHalfFloat","textureHalfFloatRender","textureLOD","texelFetch","drawBuffersExtension","depthTextureExtension","vertexArrayObject","instancedArrays","canUseTimestampForTimerQuery","multiview","oculusMultiview","blendMinMax","canUseGLInstanceID","canUseGLVertexID","supportComputeShaders","supportSRGBBuffers","supportTransformFeedbacks","textureMaxLevel","texture2DArrayMaxLayerCount","maxTextureArrayLayers","disableMorphTargetTexture","textureNorm16","forceBitmapOverHTMLImageElement","supportRenderAndCopyToLodForFloatTextures","supportDepthStencilTexture","supportShadowSamplers","uniformBufferHardCheckMatrix","allowTexturePrefiltering","trackUbosInFrame","checkUbosContentBeforeUpload","supportCSM","basisNeedsPOT","support3DTextures","needTypeSuffixInShaderConstants","supportMSAA","supportSSAO2","supportIBLShadows","supportExtendedTextureFormats","supportSwitchCaseInShader","supportSyncTextureRead","needsInvertingBitmap","useUBOBindingCache","needShaderCodeInlining","needToAlwaysBindUniformBuffers","supportRenderPasses","supportSpriteInstancing","_collectUbosUpdatedInFrame","_context","getContext","_configureContext","_setColorFormat","_mainTextureExtends","getRenderWidth","getRenderHeight","bufferDataUpdate","mainColorAttachments","mainTextureDescriptor","_mainTexture","clearValue","isStencilEnable","_setDepthTextureFormat","depthTextureDescriptor","_depthTexture","mainDepthAttachment","depthClearValue","depthLoadOp","depthStoreOp","stencilClearValue","stencilLoadOp","stencilStoreOp","depthStencilAttachment","_CommonInit","_creationOptions","configure","alphaMode","resizeImageBitmap","image","bufferWidth","bufferHeight","ResizeImageBitmap","_createImageBitmapFromSource","imageSource","CreateImageBitmapFromSource","switchFullscreen","requestPointerLock","isFullscreen","exitFullscreen","enterFullscreen","_pointerLockRequested","RequestFullscreen","ExitFullscreen","enterPointerlock","RequestPointerlock","exitPointerlock","ExitPointerlock","_rebuildBuffers","storageBuffer","_storageBuffers","initEngine","cleanScenes","mesh","meshes","subMeshes","subMesh","_drawWrappers","material","materials","_materialContext","uboList","_uniformBuffers","setSize","forceSetSize","_getCurrentRenderPass","_startRenderTargetRenderPass","_startMainRenderPass","applyStates","wipeCaches","bruteForce","preventCacheWipeBetweenFrames","_alphaEquation","setColorWrite","_cachedVertexBuffers","_cachedIndexBuffer","_cachedEffectForVertexBuffers","getColorWrite","_mustUpdateViewport","_viewportCached","_applyViewport","_viewport","_mustUpdateScissor","_applyScissor","_scissorIsActive","enableScissor","disableScissor","_mustUpdateStencilRef","_applyStencilRef","_mustUpdateBlendColor","_blendConstants","_applyBlendColor","_resetRenderPassStates","backBuffer","stencil","hasScissor","_clearFullQuad","createVertexBuffer","_updatable","Vertex","createDynamicVertexBuffer","createIndexBuffer","indices","Index","updateDynamicIndexBuffer","updateDynamicVertexBuffer","_createBuffer","BUFFER_CREATIONFLAG_READ","BUFFER_CREATIONFLAG_WRITE","BUFFER_CREATIONFLAG_UNIFORM","BUFFER_CREATIONFLAG_VERTEX","BUFFER_CREATIONFLAG_INDEX","BUFFER_CREATIONFLAG_STORAGE","BUFFER_CREATIONFLAG_INDIRECT","bindBuffersDirectly","updateAndBindInstancesBuffer","unbindInstanceAttributes","bindBuffers","_releaseBuffer","createUniformBuffer","elements","createDynamicUniformBuffer","updateUniformBuffer","bindUniformBufferBase","_location","bindUniformBlock","baseName","attributesNamesOrOptions","uniformsNamesOrEngine","fallbacks","onCompiled","extraInitializationsAsync","vertexToken","vertexSource","vertexElement","fragmentToken","fragmentSource","fragmentElement","globalDefines","_getGlobalDefines","fullDefines","_compiledEffects","compiledEffect","_refCount","Effect","errors","onEffectErrorObservable","_compileRawShaderToSpirV","compileGLSL","_compileShaderToSpirV","shaderVersion","_getWGSLShader","_createPipelineStageDescriptor","vertexShader","fragmentShader","disableUniformityAnalysisInVertex","disableUniformityAnalysisInFragment","_compileRawPipelineStageDescriptor","_compilePipelineStageDescriptor","onBeforeShaderCompilationObservable","program","onAfterShaderCompilationObservable","createRawShaderProgram","createShaderProgram","inlineShaderCode","sci","createPipelineContext","_preparePipelineContext","vertexSourceCode","fragmentSourceCode","createAsRaw","rawVertexSourceCode","rawFragmentSourceCode","_rebuildRebind","_transformFeedbackVaryings","_key","onReady","webGpuContext","rawVertex","rawFragment","results","gpuPipelineContext","attributeName","attributeLocation","enableEffect","IsWrapper","_currentEffect","onBind","_onBindObservable","_releaseEffect","_deletePipelineContext","getPipelineContext","releaseEffects","webGPUPipelineContext","resetCachedPipeline","needPOTTextures","_createHardwareTexture","_releaseTexture","_getRGBABufferInternalSizedFormat","updateTextureComparisonFunction","delayGPUTextureCreation","createMipMapsOnly","mimeType","_createTextureBase","img","isCompressed","processFunction","wrapWebGPUTexture","wrapWebGLTexture","_getUseSRGBBuffer","_noMipmap","_unpackFlipY","updateTextureSamplingMode","updateTextureWrappingMode","wrapU","wrapV","wrapR","updateTextureDimensions","_setInternalTexture","availableTexture","createPrefilteredCubeTexture","loadData","sphericalPolynomial","_sphericalPolynomial","SphericalPolynomial","unused","setTextureArray","isPartOfTextureArray","delayLoadState","DELAYLOADSTATE_NOTLOADED","delayLoad","getInternalTexture","emptyCubeTexture","emptyTexture3D","emptyTexture2DArray","emptyTexture","isMultiview","_cachedCoordinatesMode","coordinatesMode","textureWrapMode","TEXTURE_CUBIC_MODE","TEXTURE_SKYBOX_MODE","_setAnisotropicLevel","anisotropicFilteringLevel","target","_bindTexture","updateTextureData","imageData","xOffset","yOffset","lod","_uploadCompressedDataToTextureDirectly","internalFormat","_uploadDataToTextureDirectly","babylonInternalFormat","useTextureWidthAndHeight","lodMaxWidth","round","log","LOG2E","lodMaxHeight","pow","_uploadArrayBufferViewToTexture","_uploadImageToTexture","HTMLImageElement","bitmap","hasAlpha","gpuTextureFormat","_measureFps","sampleFrame","_fps","averageFPS","_deltaTime","instantaneousFrameTime","performanceMonitor","beginFrame","list","_UpdatedUbosInFrame","extractDriverInfo","_currentFrameBufferIsDefaultFrameBuffer","renderTargetWrapper","setClearStates","gpuDepthStencilWrapper","gpuDepthStencilTexture","gpuDepthStencilMSAATexture","depthTextureView","depthMSAATextureView","depthTextureHasStencil","setDepthFunctionToGreaterOrEqual","clearColorForIntegerRT","mustClearColor","mustClearDepth","mustClearStencil","_attachments","_mrtAttachments","_defaultAttachments","mrtTexture","gpuMRTWrapper","gpuMRTTexture","getBaseArrayLayer","viewDescriptor","msaaViewDescriptor","isRTInteger","colorTextureView","colorMSAATextureView","resolveTarget","depthSlice","layerIndices","_debugPushGroup","_debugFlushPendingCommands","swapChainTexture","getCurrentTexture","_isStencilEnable","bindFramebuffer","requiredWidth","requiredHeight","forceFullscreenViewport","lodLevel","layer","unBindFramebuffer","_cachedViewport","disableGenerateMipMaps","onBeforeUnbind","saveCRT","generateMipMapsMultiFramebuffer","generateMipMapsFramebuffer","resolveFramebuffer","_texture","restoreDefaultFramebuffer","setDitheringState","setRasterizerState","_executeWhenRenderingStateIsCompiled","action","bindSamplers","_getUnpackAlignement","_bindTextureDirectly","setState","culling","force","reverseSide","cullBackFaces","setZOffset","setZOffsetUnits","_applyRenderPassChanges","mustUpdateStencilRef","mustUpdateBlendColor","_draw","drawType","instancesCount","textureIsDepth","setIndexBuffer","setVertexBuffer","nonCompatMode","drawIndexedIndirect","drawIndirect","drawIndexed","drawElementsType","indexStart","indexCount","drawArraysType","verticesStart","verticesCount","hideLoadingUI","_CommonDispose","useScreen","getError","createExternalTexture","setExternalTexture","setTextureSampler","createStorageBuffer","updateStorageBuffer","_readFromGPUBuffer","noDelay","readFromBuffer","ctor","onEndFrameObservable","addOnce","readFromStorageBuffer","readFromMultipleStorageBuffers","storageBuffers","setStorageBuffer"],"mappings":"uqBAGO,MAAMA,EACT,6BAAOC,CAAuBC,EAAOC,GACjC,OAAOC,EAAMC,KAAKC,IAAIJ,EAAOC,IAAW,CAChD,CACI,+BAAOI,CAAyBC,GAC5B,OAAQA,GAEJ,IAAK,UACL,IAAK,SACL,IAAK,WACL,IAAK,UACL,IAAK,aACL,IAAK,kBACL,IAAK,YACL,IAAK,aACL,IAAK,kBACL,IAAK,cACL,IAAK,eACL,IAAK,eACL,IAAK,gBACL,IAAK,iBACL,IAAK,sBACL,IAAK,kBACL,IAAK,eACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,cACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,mBACL,IAAK,wBACL,IAAK,kBACL,IAAK,uBACL,IAAK,eACL,IAAK,gBACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,kBACL,IAAK,uBACL,IAAK,kBACL,IAAK,uBACL,IAAK,kBACL,IA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ACL,IAAK,UACL,IAAK,UACL,IAAK,eACL,IAAK,WACL,IAAK,WACL,IAAK,WACL,IAAK,UACL,IAAK,UACL,IAAK,WACL,IAAK,eACL,IAAK,WACL,IAAK,cACL,IAAK,eACL,IAAK,eACD,OAAO,EACX,IAAK,WACL,IAAK,WACL,IAAK,UACL,IAAK,UACL,IAAK,wBACL,IAAK,eACL,IAAK,eACL,IAAK,WACL,IAAK,WACL,IAAK,YACL,IAAK,YACL,IAAK,YACL,IAAK,WACL,IAAK,WACL,IAAK,YACL,IAAK,uBACL,IAAK,gBACL,IAAK,gBACD,OAAO,EACX,IAAK,eACL,IAAK,gBACL,IAAK,kBACL,IAAK,iBACL,IAAK,iBACL,IAAK,sBACD,OAAO,EACX,IAAK,aACL,IAAK,kBACL,IAAK,aACL,IAAK,YACL,IAAK,YACL,IAAK,aACL,IAAK,kBACL,IAAK,cACL,IAAK,cACL,IAAK,cACL,IAAK,eACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,aACL,IAAK,aACL,IAAK,cACL,IAAK,aACL,IAAK,aACL,IAAK,cACL,IAAK,mBACL,IAAK,wBACL,IAAK,kBACL,IAAK,uBACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,iBACL,IAAK,sBACL,IAAK,kBACL,IAAK,uBACL,IAAK,kBACL,IAAK,uBACL,IAAK,kBACL,IAAK,uBACL,IAAK,mBACL,IAAK,wBACL,IAAK,mBACL,IAAK,wBACL,IAAK,mBACL,IAAK,wBACD,OAAO,EAGf,KAAM,kBAAkBA,IAChC,CACI,uBAAOgE,CAAiBhE,GACpB,OAAQA,GACJ,IAAK,WACL,IAAK,wBACL,IAAK,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