@zephyr3d/editor 0.3.4 → 0.3.5
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/dist/assets/{index-DzQzWsCG.js → index-DlnbO59X.js} +2 -2
- package/dist/assistant/zephyr-types-index.json +9 -10
- package/dist/index.html +1 -1
- package/dist/modules/zephyr3d_backend-webgpu.js +13 -12
- package/dist/modules/zephyr3d_backend-webgpu.js.map +1 -1
- package/dist/modules/zephyr3d_base.js +152 -152
- package/dist/modules/zephyr3d_base.js.map +1 -1
- package/dist/modules/zephyr3d_device.js +15 -15
- package/dist/modules/zephyr3d_device.js.map +1 -1
- package/dist/modules/zephyr3d_loaders.js +6 -6
- package/dist/modules/zephyr3d_loaders.js.map +1 -1
- package/dist/modules/zephyr3d_scene.js +1382 -1385
- package/dist/modules/zephyr3d_scene.js.map +1 -1
- package/dist/vendor/zephyr3d/backend-webgpu/dist/capabilities_webgpu.js +7 -6
- package/dist/vendor/zephyr3d/backend-webgpu/dist/capabilities_webgpu.js.map +1 -1
- package/dist/vendor/zephyr3d/backend-webgpu/dist/renderpass_webgpu.js +6 -6
- package/dist/vendor/zephyr3d/backend-webgpu/dist/renderpass_webgpu.js.map +1 -1
- package/dist/vendor/zephyr3d/base/dist/vfs/common.js +152 -152
- package/dist/vendor/zephyr3d/base/dist/vfs/common.js.map +1 -1
- package/dist/vendor/zephyr3d/device/dist/device.js +15 -15
- package/dist/vendor/zephyr3d/device/dist/device.js.map +1 -1
- package/dist/vendor/zephyr3d/loaders/dist/gltf/gltf_importer.js +6 -6
- package/dist/vendor/zephyr3d/loaders/dist/gltf/gltf_importer.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/animation/animationset.js +191 -194
- package/dist/vendor/zephyr3d/scene/dist/animation/animationset.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/animation/joint_dynamics_modifier.js +19 -19
- package/dist/vendor/zephyr3d/scene/dist/animation/joint_dynamics_modifier.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/app/engine.js +131 -131
- package/dist/vendor/zephyr3d/scene/dist/app/engine.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/app/scriptregistry.js +119 -119
- package/dist/vendor/zephyr3d/scene/dist/app/scriptregistry.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/asset/model.js +62 -62
- package/dist/vendor/zephyr3d/scene/dist/asset/model.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/avatar/wardrobe.js +13 -13
- package/dist/vendor/zephyr3d/scene/dist/avatar/wardrobe.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/camera/camera.js +201 -201
- package/dist/vendor/zephyr3d/scene/dist/camera/camera.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/index.d.ts +1 -1
- package/dist/vendor/zephyr3d/scene/dist/material/mixins/lightmodel/pbrmetallicroughness.js +5 -5
- package/dist/vendor/zephyr3d/scene/dist/material/mixins/lightmodel/pbrmetallicroughness.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/material/mtoon.js +4 -4
- package/dist/vendor/zephyr3d/scene/dist/material/mtoon.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/material/pbrblueprint.js +11 -11
- package/dist/vendor/zephyr3d/scene/dist/material/pbrblueprint.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/material/shader/helper.js +284 -284
- package/dist/vendor/zephyr3d/scene/dist/material/shader/helper.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/posteffect/ssr.js +9 -9
- package/dist/vendor/zephyr3d/scene/dist/posteffect/ssr.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/render/lightpass.js +5 -5
- package/dist/vendor/zephyr3d/scene/dist/render/lightpass.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/render/renderer.js +7 -7
- package/dist/vendor/zephyr3d/scene/dist/render/renderer.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/shadow/esm.js +1 -1
- package/dist/vendor/zephyr3d/scene/dist/shadow/esm.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/shadow/shadow_region.js +45 -45
- package/dist/vendor/zephyr3d/scene/dist/shadow/shadow_region.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/utility/serialization/manager.js +275 -275
- package/dist/vendor/zephyr3d/scene/dist/utility/serialization/manager.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/camera.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/mesh.js.map +1 -1
- package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/sprite.js.map +1 -1
- package/package.json +3 -3
- package/dist/vendor/zephyr3d/scene/dist/animation/joint_dynamics/convex_collider.js +0 -320
- package/dist/vendor/zephyr3d/scene/dist/animation/joint_dynamics/convex_collider.js.map +0 -1
|
@@ -93,6 +93,7 @@ class WebGPUTextureCaps {
|
|
|
93
93
|
this.maxCubeTextureSize = device.device.limits.maxTextureDimension2D;
|
|
94
94
|
this.npo2Mipmapping = true;
|
|
95
95
|
this.npo2Repeating = true;
|
|
96
|
+
const float32Filterable = device.device.features.has('float32-filterable');
|
|
96
97
|
this._textureFormatInfos = {
|
|
97
98
|
['rgba8unorm']: {
|
|
98
99
|
gpuSampleType: 'float',
|
|
@@ -344,8 +345,8 @@ class WebGPUTextureCaps {
|
|
|
344
345
|
size: 2
|
|
345
346
|
};
|
|
346
347
|
this._textureFormatInfos['r32f'] = {
|
|
347
|
-
gpuSampleType: 'unfilterable-float',
|
|
348
|
-
filterable:
|
|
348
|
+
gpuSampleType: float32Filterable ? 'float' : 'unfilterable-float',
|
|
349
|
+
filterable: float32Filterable,
|
|
349
350
|
renderable: true,
|
|
350
351
|
compressed: false,
|
|
351
352
|
writable: true,
|
|
@@ -444,8 +445,8 @@ class WebGPUTextureCaps {
|
|
|
444
445
|
size: 4
|
|
445
446
|
};
|
|
446
447
|
this._textureFormatInfos['rg32f'] = {
|
|
447
|
-
gpuSampleType: 'unfilterable-float',
|
|
448
|
-
filterable:
|
|
448
|
+
gpuSampleType: float32Filterable ? 'float' : 'unfilterable-float',
|
|
449
|
+
filterable: float32Filterable,
|
|
449
450
|
renderable: true,
|
|
450
451
|
compressed: false,
|
|
451
452
|
writable: true,
|
|
@@ -544,8 +545,8 @@ class WebGPUTextureCaps {
|
|
|
544
545
|
size: 8
|
|
545
546
|
};
|
|
546
547
|
this._textureFormatInfos['rgba32f'] = {
|
|
547
|
-
gpuSampleType: 'unfilterable-float',
|
|
548
|
-
filterable:
|
|
548
|
+
gpuSampleType: float32Filterable ? 'float' : 'unfilterable-float',
|
|
549
|
+
filterable: float32Filterable,
|
|
549
550
|
renderable: true,
|
|
550
551
|
compressed: false,
|
|
551
552
|
writable: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities_webgpu.js","sources":["../src/capabilities_webgpu.ts"],"sourcesContent":["import type {\r\n TextureFormat,\r\n FramebufferCaps,\r\n TextureFormatInfo,\r\n MiscCaps,\r\n ShaderCaps,\r\n TextureCaps\r\n} from '@zephyr3d/device';\r\nimport type { WebGPUDevice } from './device';\r\nimport type { Immutable } from '@zephyr3d/base';\r\n\r\nexport interface TextureParams {\r\n gpuFormat: GPUTextureFormat;\r\n stride: number;\r\n filterable: boolean;\r\n renderable: boolean;\r\n repeatable: boolean;\r\n compressed: boolean;\r\n writable: boolean;\r\n generateMipmap: boolean;\r\n}\r\n\r\nexport interface TextureFormatInfoWebGPU extends TextureFormatInfo {\r\n gpuSampleType: GPUTextureSampleType;\r\n filterable: boolean;\r\n renderable: boolean;\r\n compressed: boolean;\r\n writable: boolean;\r\n}\r\n\r\nexport class WebGPUFramebufferCaps implements FramebufferCaps {\r\n maxDrawBuffers: number;\r\n maxColorAttachmentBytesPerSample: number;\r\n supportRenderMipmap: boolean;\r\n supportMultisampledFramebuffer: boolean;\r\n supportFloatBlending: boolean;\r\n supportDepth32float: boolean;\r\n supportDepth32floatStencil8: boolean;\r\n constructor(device: WebGPUDevice) {\r\n this.maxDrawBuffers = device.device.limits.maxColorAttachments;\r\n this.maxColorAttachmentBytesPerSample = device.device.limits.maxColorAttachmentBytesPerSample;\r\n this.supportRenderMipmap = true;\r\n this.supportMultisampledFramebuffer = true;\r\n this.supportFloatBlending = device.device.features.has('float32-blendable');\r\n this.supportDepth32float = true;\r\n this.supportDepth32floatStencil8 = device.device.features.has('depth32float-stencil8');\r\n }\r\n}\r\n\r\nexport class WebGPUMiscCaps implements MiscCaps {\r\n supportOversizedViewport: boolean;\r\n supportBlendMinMax: boolean;\r\n support32BitIndex: boolean;\r\n supportDepthClamp: boolean;\r\n maxBindGroups: number;\r\n maxTexCoordIndex: number;\r\n constructor(device: WebGPUDevice) {\r\n this.supportOversizedViewport = false;\r\n this.supportBlendMinMax = true;\r\n this.support32BitIndex = true;\r\n this.supportDepthClamp = device.device.features.has('depth-clip-control');\r\n this.maxBindGroups = 4;\r\n this.maxTexCoordIndex = 8;\r\n }\r\n}\r\nexport class WebGPUShaderCaps implements ShaderCaps {\r\n supportFragmentDepth: boolean;\r\n supportStandardDerivatives: boolean;\r\n supportShaderTextureLod: boolean;\r\n supportHighPrecisionFloat: boolean;\r\n maxUniformBufferSize: number;\r\n uniformBufferOffsetAlignment: number;\r\n maxStorageBufferSize: number;\r\n storageBufferOffsetAlignment: number;\r\n constructor(device: WebGPUDevice) {\r\n this.supportFragmentDepth = true;\r\n this.supportStandardDerivatives = true;\r\n this.supportShaderTextureLod = true;\r\n this.supportHighPrecisionFloat = true;\r\n this.maxUniformBufferSize = device.device.limits.maxUniformBufferBindingSize || 65536;\r\n this.uniformBufferOffsetAlignment = device.device.limits.minUniformBufferOffsetAlignment || 256;\r\n this.maxStorageBufferSize = device.device.limits.maxStorageBufferBindingSize || 128 * 1024 * 1024;\r\n this.storageBufferOffsetAlignment = device.device.limits.minStorageBufferOffsetAlignment || 256;\r\n }\r\n}\r\nexport class WebGPUTextureCaps implements TextureCaps {\r\n private readonly _textureFormatInfos: Record<TextureFormat, TextureFormatInfoWebGPU>;\r\n maxTextureSize: number;\r\n maxCubeTextureSize: number;\r\n npo2Mipmapping: boolean;\r\n npo2Repeating: boolean;\r\n supportS3TC: boolean;\r\n supportS3TCSRGB: boolean;\r\n supportBPTC: boolean;\r\n supportRGTC: boolean;\r\n supportASTC: boolean;\r\n supportDepthTexture: boolean;\r\n support3DTexture: boolean;\r\n supportSRGBTexture: boolean;\r\n supportFloatTexture: boolean;\r\n supportLinearFloatTexture: boolean;\r\n supportHalfFloatTexture: boolean;\r\n supportLinearHalfFloatTexture: boolean;\r\n supportAnisotropicFiltering: boolean;\r\n supportFloatColorBuffer: boolean;\r\n supportHalfFloatColorBuffer: boolean;\r\n supportFloatBlending: boolean;\r\n constructor(device: WebGPUDevice) {\r\n this.supportAnisotropicFiltering = true;\r\n this.supportDepthTexture = true;\r\n this.support3DTexture = true;\r\n this.supportSRGBTexture = true;\r\n this.supportFloatTexture = true;\r\n this.supportFloatColorBuffer = true;\r\n this.supportHalfFloatColorBuffer = true;\r\n this.supportFloatBlending = true;\r\n this.supportS3TC = device.device.features.has('texture-compression-bc');\r\n this.supportS3TCSRGB = this.supportS3TC;\r\n this.supportBPTC = this.supportS3TC;\r\n this.supportRGTC = this.supportS3TC;\r\n this.supportASTC = device.device.features.has('texture-compression-astc');\r\n this.supportHalfFloatTexture = true;\r\n this.maxTextureSize = device.device.limits.maxTextureDimension2D;\r\n this.maxCubeTextureSize = device.device.limits.maxTextureDimension2D;\r\n this.npo2Mipmapping = true;\r\n this.npo2Repeating = true;\r\n this._textureFormatInfos = {\r\n ['rgba8unorm']: {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n },\r\n ['rgba8snorm']: {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n },\r\n ['bgra8unorm']: {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: false, // TODO: require \"bgra8unorm-storage\" feature\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n }\r\n } as Record<TextureFormat, TextureFormatInfoWebGPU>;\r\n if (this.supportASTC) {\r\n for (const k of [\r\n '4x4',\r\n '5x4',\r\n '5x5',\r\n '6x5',\r\n '6x6',\r\n '8x5',\r\n '8x6',\r\n '8x8',\r\n '10x5',\r\n '10x6',\r\n '10x8',\r\n '10x10',\r\n '12x10',\r\n '12x12'\r\n ]) {\r\n const [w, h] = k.split('x').map((val) => Number(val));\r\n this._textureFormatInfos[`astc-${k}` as keyof typeof this._textureFormatInfos] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: w,\r\n blockHeight: h\r\n };\r\n this._textureFormatInfos[`astc-${k}-srgb` as keyof typeof this._textureFormatInfos] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n size: 16,\r\n writable: false,\r\n blockWidth: w,\r\n blockHeight: h\r\n };\r\n }\r\n }\r\n if (this.supportS3TC) {\r\n this._textureFormatInfos['dxt1'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 8,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['dxt3'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['dxt5'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n }\r\n if (this.supportRGTC) {\r\n this._textureFormatInfos['bc4'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 8,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['bc4-signed'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 8,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n }\r\n this._textureFormatInfos['bc5'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['bc5-signed'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n if (this.supportBPTC) {\r\n this._textureFormatInfos['bc6h'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['bc6h-signed'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['bc7'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['bc7-srgb'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n }\r\n if (this.supportS3TCSRGB) {\r\n this._textureFormatInfos['dxt1-srgb'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 8,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['dxt3-srgb'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['dxt5-srgb'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n }\r\n this._textureFormatInfos['r8unorm'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 1\r\n };\r\n this._textureFormatInfos['r8snorm'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 1\r\n };\r\n this._textureFormatInfos['r16f'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 2\r\n };\r\n this._textureFormatInfos['r32f'] = {\r\n gpuSampleType: 'unfilterable-float',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['r8ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 1\r\n };\r\n this._textureFormatInfos['r8i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 1\r\n };\r\n this._textureFormatInfos['r16ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 2\r\n };\r\n this._textureFormatInfos['r16i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 2\r\n };\r\n this._textureFormatInfos['r32ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['r32i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['rg8unorm'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 2\r\n };\r\n this._textureFormatInfos['rg8snorm'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 2\r\n };\r\n this._textureFormatInfos['rg16f'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['rg32f'] = {\r\n gpuSampleType: 'unfilterable-float',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 8\r\n };\r\n this._textureFormatInfos['rg8ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 2\r\n };\r\n this._textureFormatInfos['rg8i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 2\r\n };\r\n this._textureFormatInfos['rg16ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['rg16i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['rg32ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 8\r\n };\r\n this._textureFormatInfos['rg32i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 8\r\n };\r\n this._textureFormatInfos['rgba8unorm-srgb'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['bgra8unorm-srgb'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['rgba16f'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 8\r\n };\r\n this._textureFormatInfos['rgba32f'] = {\r\n gpuSampleType: 'unfilterable-float',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 16\r\n };\r\n this._textureFormatInfos['rgba8ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['rgba8i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['rgba16ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 8\r\n };\r\n this._textureFormatInfos['rgba16i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 8\r\n };\r\n this._textureFormatInfos['rgba32ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 16\r\n };\r\n this._textureFormatInfos['rgba32i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 16\r\n };\r\n this._textureFormatInfos['rg11b10uf'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: device.device.features.has('rg11b10ufloat-renderable'),\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['d16'] = {\r\n gpuSampleType: 'depth',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 2\r\n };\r\n this._textureFormatInfos['d24'] = {\r\n gpuSampleType: 'depth',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['d32f'] = {\r\n gpuSampleType: 'depth',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['d32fs8'] = {\r\n gpuSampleType: 'depth',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 8\r\n };\r\n this._textureFormatInfos['d24s8'] = {\r\n gpuSampleType: 'depth',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this.supportLinearFloatTexture =\r\n this._textureFormatInfos['r32f'].filterable &&\r\n this._textureFormatInfos['rg32f'].filterable &&\r\n this._textureFormatInfos['rgba32f'].filterable;\r\n this.supportLinearHalfFloatTexture =\r\n this._textureFormatInfos['r16f'].filterable &&\r\n this._textureFormatInfos['rg16f'].filterable &&\r\n this._textureFormatInfos['rgba16f'].filterable;\r\n }\r\n calcMemoryUsage(format: TextureFormat, numPixels: number) {\r\n return this._textureFormatInfos[format] ? this._textureFormatInfos[format].size * numPixels : 0;\r\n }\r\n getTextureFormatInfo(format: TextureFormat): Immutable<TextureFormatInfoWebGPU> {\r\n return this._textureFormatInfos[format];\r\n }\r\n}\r\n"],"names":["WebGPUFramebufferCaps","maxDrawBuffers","maxColorAttachmentBytesPerSample","supportRenderMipmap","supportMultisampledFramebuffer","supportFloatBlending","supportDepth32float","supportDepth32floatStencil8","device","limits","maxColorAttachments","features","has","WebGPUMiscCaps","supportOversizedViewport","supportBlendMinMax","support32BitIndex","supportDepthClamp","maxBindGroups","maxTexCoordIndex","WebGPUShaderCaps","supportFragmentDepth","supportStandardDerivatives","supportShaderTextureLod","supportHighPrecisionFloat","maxUniformBufferSize","uniformBufferOffsetAlignment","maxStorageBufferSize","storageBufferOffsetAlignment","maxUniformBufferBindingSize","minUniformBufferOffsetAlignment","maxStorageBufferBindingSize","minStorageBufferOffsetAlignment","WebGPUTextureCaps","_textureFormatInfos","maxTextureSize","maxCubeTextureSize","npo2Mipmapping","npo2Repeating","supportS3TC","supportS3TCSRGB","supportBPTC","supportRGTC","supportASTC","supportDepthTexture","support3DTexture","supportSRGBTexture","supportFloatTexture","supportLinearFloatTexture","supportHalfFloatTexture","supportLinearHalfFloatTexture","supportAnisotropicFiltering","supportFloatColorBuffer","supportHalfFloatColorBuffer","maxTextureDimension2D","gpuSampleType","filterable","renderable","compressed","writable","blockWidth","blockHeight","size","k","w","h","split","map","val","Number","calcMemoryUsage","format","numPixels","getTextureFormatInfo"],"mappings":"AA8BO,MAAMA,qBAAAA,CAAAA;IACXC,cAAuB;IACvBC,gCAAyC;IACzCC,mBAA6B;IAC7BC,8BAAwC;IACxCC,oBAA8B;IAC9BC,mBAA6B;IAC7BC,2BAAqC;AACrC,IAAA,WAAA,CAAYC,MAAoB,CAAE;QAChC,IAAI,CAACP,cAAc,GAAGO,MAAAA,CAAOA,MAAM,CAACC,MAAM,CAACC,mBAAmB;QAC9D,IAAI,CAACR,gCAAgC,GAAGM,MAAAA,CAAOA,MAAM,CAACC,MAAM,CAACP,gCAAgC;QAC7F,IAAI,CAACC,mBAAmB,GAAG,IAAA;QAC3B,IAAI,CAACC,8BAA8B,GAAG,IAAA;QACtC,IAAI,CAACC,oBAAoB,GAAGG,MAAAA,CAAOA,MAAM,CAACG,QAAQ,CAACC,GAAG,CAAC,mBAAA,CAAA;QACvD,IAAI,CAACN,mBAAmB,GAAG,IAAA;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BAAmB,CAACqC,MAAO,CAAA;AACzC;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"capabilities_webgpu.js","sources":["../src/capabilities_webgpu.ts"],"sourcesContent":["import type {\r\n TextureFormat,\r\n FramebufferCaps,\r\n TextureFormatInfo,\r\n MiscCaps,\r\n ShaderCaps,\r\n TextureCaps\r\n} from '@zephyr3d/device';\r\nimport type { WebGPUDevice } from './device';\r\nimport type { Immutable } from '@zephyr3d/base';\r\n\r\nexport interface TextureParams {\r\n gpuFormat: GPUTextureFormat;\r\n stride: number;\r\n filterable: boolean;\r\n renderable: boolean;\r\n repeatable: boolean;\r\n compressed: boolean;\r\n writable: boolean;\r\n generateMipmap: boolean;\r\n}\r\n\r\nexport interface TextureFormatInfoWebGPU extends TextureFormatInfo {\r\n gpuSampleType: GPUTextureSampleType;\r\n filterable: boolean;\r\n renderable: boolean;\r\n compressed: boolean;\r\n writable: boolean;\r\n}\r\n\r\nexport class WebGPUFramebufferCaps implements FramebufferCaps {\r\n maxDrawBuffers: number;\r\n maxColorAttachmentBytesPerSample: number;\r\n supportRenderMipmap: boolean;\r\n supportMultisampledFramebuffer: boolean;\r\n supportFloatBlending: boolean;\r\n supportDepth32float: boolean;\r\n supportDepth32floatStencil8: boolean;\r\n constructor(device: WebGPUDevice) {\r\n this.maxDrawBuffers = device.device.limits.maxColorAttachments;\r\n this.maxColorAttachmentBytesPerSample = device.device.limits.maxColorAttachmentBytesPerSample;\r\n this.supportRenderMipmap = true;\r\n this.supportMultisampledFramebuffer = true;\r\n this.supportFloatBlending = device.device.features.has('float32-blendable');\r\n this.supportDepth32float = true;\r\n this.supportDepth32floatStencil8 = device.device.features.has('depth32float-stencil8');\r\n }\r\n}\r\n\r\nexport class WebGPUMiscCaps implements MiscCaps {\r\n supportOversizedViewport: boolean;\r\n supportBlendMinMax: boolean;\r\n support32BitIndex: boolean;\r\n supportDepthClamp: boolean;\r\n maxBindGroups: number;\r\n maxTexCoordIndex: number;\r\n constructor(device: WebGPUDevice) {\r\n this.supportOversizedViewport = false;\r\n this.supportBlendMinMax = true;\r\n this.support32BitIndex = true;\r\n this.supportDepthClamp = device.device.features.has('depth-clip-control');\r\n this.maxBindGroups = 4;\r\n this.maxTexCoordIndex = 8;\r\n }\r\n}\r\nexport class WebGPUShaderCaps implements ShaderCaps {\r\n supportFragmentDepth: boolean;\r\n supportStandardDerivatives: boolean;\r\n supportShaderTextureLod: boolean;\r\n supportHighPrecisionFloat: boolean;\r\n maxUniformBufferSize: number;\r\n uniformBufferOffsetAlignment: number;\r\n maxStorageBufferSize: number;\r\n storageBufferOffsetAlignment: number;\r\n constructor(device: WebGPUDevice) {\r\n this.supportFragmentDepth = true;\r\n this.supportStandardDerivatives = true;\r\n this.supportShaderTextureLod = true;\r\n this.supportHighPrecisionFloat = true;\r\n this.maxUniformBufferSize = device.device.limits.maxUniformBufferBindingSize || 65536;\r\n this.uniformBufferOffsetAlignment = device.device.limits.minUniformBufferOffsetAlignment || 256;\r\n this.maxStorageBufferSize = device.device.limits.maxStorageBufferBindingSize || 128 * 1024 * 1024;\r\n this.storageBufferOffsetAlignment = device.device.limits.minStorageBufferOffsetAlignment || 256;\r\n }\r\n}\r\nexport class WebGPUTextureCaps implements TextureCaps {\r\n private readonly _textureFormatInfos: Record<TextureFormat, TextureFormatInfoWebGPU>;\r\n maxTextureSize: number;\r\n maxCubeTextureSize: number;\r\n npo2Mipmapping: boolean;\r\n npo2Repeating: boolean;\r\n supportS3TC: boolean;\r\n supportS3TCSRGB: boolean;\r\n supportBPTC: boolean;\r\n supportRGTC: boolean;\r\n supportASTC: boolean;\r\n supportDepthTexture: boolean;\r\n support3DTexture: boolean;\r\n supportSRGBTexture: boolean;\r\n supportFloatTexture: boolean;\r\n supportLinearFloatTexture: boolean;\r\n supportHalfFloatTexture: boolean;\r\n supportLinearHalfFloatTexture: boolean;\r\n supportAnisotropicFiltering: boolean;\r\n supportFloatColorBuffer: boolean;\r\n supportHalfFloatColorBuffer: boolean;\r\n supportFloatBlending: boolean;\r\n constructor(device: WebGPUDevice) {\r\n this.supportAnisotropicFiltering = true;\r\n this.supportDepthTexture = true;\r\n this.support3DTexture = true;\r\n this.supportSRGBTexture = true;\r\n this.supportFloatTexture = true;\r\n this.supportFloatColorBuffer = true;\r\n this.supportHalfFloatColorBuffer = true;\r\n this.supportFloatBlending = true;\r\n this.supportS3TC = device.device.features.has('texture-compression-bc');\r\n this.supportS3TCSRGB = this.supportS3TC;\r\n this.supportBPTC = this.supportS3TC;\r\n this.supportRGTC = this.supportS3TC;\r\n this.supportASTC = device.device.features.has('texture-compression-astc');\r\n this.supportHalfFloatTexture = true;\r\n this.maxTextureSize = device.device.limits.maxTextureDimension2D;\r\n this.maxCubeTextureSize = device.device.limits.maxTextureDimension2D;\r\n this.npo2Mipmapping = true;\r\n this.npo2Repeating = true;\r\n const float32Filterable = device.device.features.has('float32-filterable');\r\n this._textureFormatInfos = {\r\n ['rgba8unorm']: {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n },\r\n ['rgba8snorm']: {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n },\r\n ['bgra8unorm']: {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: false, // TODO: require \"bgra8unorm-storage\" feature\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n }\r\n } as Record<TextureFormat, TextureFormatInfoWebGPU>;\r\n if (this.supportASTC) {\r\n for (const k of [\r\n '4x4',\r\n '5x4',\r\n '5x5',\r\n '6x5',\r\n '6x6',\r\n '8x5',\r\n '8x6',\r\n '8x8',\r\n '10x5',\r\n '10x6',\r\n '10x8',\r\n '10x10',\r\n '12x10',\r\n '12x12'\r\n ]) {\r\n const [w, h] = k.split('x').map((val) => Number(val));\r\n this._textureFormatInfos[`astc-${k}` as keyof typeof this._textureFormatInfos] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: w,\r\n blockHeight: h\r\n };\r\n this._textureFormatInfos[`astc-${k}-srgb` as keyof typeof this._textureFormatInfos] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n size: 16,\r\n writable: false,\r\n blockWidth: w,\r\n blockHeight: h\r\n };\r\n }\r\n }\r\n if (this.supportS3TC) {\r\n this._textureFormatInfos['dxt1'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 8,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['dxt3'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['dxt5'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n }\r\n if (this.supportRGTC) {\r\n this._textureFormatInfos['bc4'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 8,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['bc4-signed'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 8,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n }\r\n this._textureFormatInfos['bc5'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['bc5-signed'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n if (this.supportBPTC) {\r\n this._textureFormatInfos['bc6h'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['bc6h-signed'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['bc7'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['bc7-srgb'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n }\r\n if (this.supportS3TCSRGB) {\r\n this._textureFormatInfos['dxt1-srgb'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 8,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['dxt3-srgb'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n this._textureFormatInfos['dxt5-srgb'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: true,\r\n writable: false,\r\n size: 16,\r\n blockWidth: 4,\r\n blockHeight: 4\r\n };\r\n }\r\n this._textureFormatInfos['r8unorm'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 1\r\n };\r\n this._textureFormatInfos['r8snorm'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 1\r\n };\r\n this._textureFormatInfos['r16f'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 2\r\n };\r\n this._textureFormatInfos['r32f'] = {\r\n gpuSampleType: float32Filterable ? 'float' : 'unfilterable-float',\r\n filterable: float32Filterable,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['r8ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 1\r\n };\r\n this._textureFormatInfos['r8i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 1\r\n };\r\n this._textureFormatInfos['r16ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 2\r\n };\r\n this._textureFormatInfos['r16i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 2\r\n };\r\n this._textureFormatInfos['r32ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['r32i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['rg8unorm'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 2\r\n };\r\n this._textureFormatInfos['rg8snorm'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: false,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 2\r\n };\r\n this._textureFormatInfos['rg16f'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['rg32f'] = {\r\n gpuSampleType: float32Filterable ? 'float' : 'unfilterable-float',\r\n filterable: float32Filterable,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 8\r\n };\r\n this._textureFormatInfos['rg8ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 2\r\n };\r\n this._textureFormatInfos['rg8i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 2\r\n };\r\n this._textureFormatInfos['rg16ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['rg16i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['rg32ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 8\r\n };\r\n this._textureFormatInfos['rg32i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 8\r\n };\r\n this._textureFormatInfos['rgba8unorm-srgb'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['bgra8unorm-srgb'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['rgba16f'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 8\r\n };\r\n this._textureFormatInfos['rgba32f'] = {\r\n gpuSampleType: float32Filterable ? 'float' : 'unfilterable-float',\r\n filterable: float32Filterable,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 16\r\n };\r\n this._textureFormatInfos['rgba8ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['rgba8i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['rgba16ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 8\r\n };\r\n this._textureFormatInfos['rgba16i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 8\r\n };\r\n this._textureFormatInfos['rgba32ui'] = {\r\n gpuSampleType: 'uint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 16\r\n };\r\n this._textureFormatInfos['rgba32i'] = {\r\n gpuSampleType: 'sint',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: true,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 16\r\n };\r\n this._textureFormatInfos['rg11b10uf'] = {\r\n gpuSampleType: 'float',\r\n filterable: true,\r\n renderable: device.device.features.has('rg11b10ufloat-renderable'),\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['d16'] = {\r\n gpuSampleType: 'depth',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 2\r\n };\r\n this._textureFormatInfos['d24'] = {\r\n gpuSampleType: 'depth',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['d32f'] = {\r\n gpuSampleType: 'depth',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this._textureFormatInfos['d32fs8'] = {\r\n gpuSampleType: 'depth',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 8\r\n };\r\n this._textureFormatInfos['d24s8'] = {\r\n gpuSampleType: 'depth',\r\n filterable: false,\r\n renderable: true,\r\n compressed: false,\r\n writable: false,\r\n blockWidth: 1,\r\n blockHeight: 1,\r\n size: 4\r\n };\r\n this.supportLinearFloatTexture =\r\n this._textureFormatInfos['r32f'].filterable &&\r\n this._textureFormatInfos['rg32f'].filterable &&\r\n this._textureFormatInfos['rgba32f'].filterable;\r\n this.supportLinearHalfFloatTexture =\r\n this._textureFormatInfos['r16f'].filterable &&\r\n this._textureFormatInfos['rg16f'].filterable &&\r\n this._textureFormatInfos['rgba16f'].filterable;\r\n }\r\n calcMemoryUsage(format: TextureFormat, numPixels: number) {\r\n return this._textureFormatInfos[format] ? this._textureFormatInfos[format].size * numPixels : 0;\r\n }\r\n getTextureFormatInfo(format: TextureFormat): Immutable<TextureFormatInfoWebGPU> {\r\n return this._textureFormatInfos[format];\r\n }\r\n}\r\n"],"names":["WebGPUFramebufferCaps","maxDrawBuffers","maxColorAttachmentBytesPerSample","supportRenderMipmap","supportMultisampledFramebuffer","supportFloatBlending","supportDepth32float","supportDepth32floatStencil8","device","limits","maxColorAttachments","features","has","WebGPUMiscCaps","supportOversizedViewport","supportBlendMinMax","support32BitIndex","supportDepthClamp","maxBindGroups","maxTexCoordIndex","WebGPUShaderCaps","supportFragmentDepth","supportStandardDerivatives","supportShaderTextureLod","supportHighPrecisionFloat","maxUniformBufferSize","uniformBufferOffsetAlignment","maxStorageBufferSize","storageBufferOffsetAlignment","maxUniformBufferBindingSize","minUniformBufferOffsetAlignment","maxStorageBufferBindingSize","minStorageBufferOffsetAlignment","WebGPUTextureCaps","_textureFormatInfos","maxTextureSize","maxCubeTextureSize","npo2Mipmapping","npo2Repeating","supportS3TC","supportS3TCSRGB","supportBPTC","supportRGTC","supportASTC","supportDepthTexture","support3DTexture","supportSRGBTexture","supportFloatTexture","supportLinearFloatTexture","supportHalfFloatTexture","supportLinearHalfFloatTexture","supportAnisotropicFiltering","supportFloatColorBuffer","supportHalfFloatColorBuffer","maxTextureDimension2D","float32Filterable","gpuSampleType","filterable","renderable","compressed","writable","blockWidth","blockHeight","size","k","w","h","split","map","val","Number","calcMemoryUsage","format","numPixels","getTextureFormatInfo"],"mappings":"AA8BO,MAAMA,qBAAAA,CAAAA;IACXC,cAAuB;IACvBC,gCAAyC;IACzCC,mBAA6B;IAC7BC,8BAAwC;IACxCC,oBAA8B;IAC9BC,mBAA6B;IAC7BC,2BAAqC;AACrC,IAAA,WAAA,CAAYC,MAAoB,CAAE;QAChC,IAAI,CAACP,cAAc,GAAGO,MAAAA,CAAOA,MAAM,CAACC,MAAM,CAACC,mBAAmB;QAC9D,IAAI,CAACR,gCAAgC,GAAGM,MAAAA,CAAOA,MAAM,CAACC,MAAM,CAACP,gCAAgC;QAC7F,IAAI,CAACC,mBAAmB,GAAG,IAAA;QAC3B,IAAI,CAACC,8BAA8B,GAAG,IAAA;QACtC,IAAI,CAACC,oBAAoB,GAAGG,MAAAA,CAAOA,MAAM,CAACG,QAAQ,CAACC,GAAG,CAAC,mBAAA,CAAA;QACvD,IAAI,CAACN,mBAAmB,GAAG,IAAA;QAC3B,IAAI,CAACC,2BAA2B,GAAGC,MAAAA,CAAOA,MAAM,CAACG,QAAQ,CAACC,GAAG,CAAC,uBAAA,CAAA;AAChE;AACF;AAEO,MAAMC,cAAAA,CAAAA;IACXC,wBAAkC;IAClCC,kBAA4B;IAC5BC,iBAA2B;IAC3BC,iBAA2B;IAC3BC,aAAsB;IACtBC,gBAAyB;AACzB,IAAA,WAAA,CAAYX,MAAoB,CAAE;QAChC,IAAI,CAACM,wBAAwB,GAAG,KAAA;QAChC,IAAI,CAACC,kBAAkB,GAAG,IAAA;QAC1B,IAAI,CAAC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ACZC,UAAY,EAAA,KAAA;YACZC,QAAU,EAAA,KAAA;YACVC,UAAY,EAAA,CAAA;YACZC,WAAa,EAAA,CAAA;YACbC,IAAM,EAAA;AACR,SAAA;AACA,QAAA,IAAI,CAAC7B,mBAAmB,CAAC,OAAA,CAAQ,GAAG;YAClCsB,aAAe,EAAA,OAAA;YACfC,UAAY,EAAA,KAAA;YACZC,UAAY,EAAA,IAAA;YACZC,UAAY,EAAA,KAAA;YACZC,QAAU,EAAA,KAAA;YACVC,UAAY,EAAA,CAAA;YACZC,WAAa,EAAA,CAAA;YACbC,IAAM,EAAA;AACR,SAAA;QACA,IAAI,CAACf,yBAAyB,GAC5B,IAAI,CAACd,mBAAmB,CAAC,MAAA,CAAO,CAACuB,UAAU,IAC3C,IAAI,CAACvB,mBAAmB,CAAC,OAAQ,CAAA,CAACuB,UAAU,IAC5C,IAAI,CAACvB,mBAAmB,CAAC,SAAU,CAAA,CAACuB,UAAU;QAChD,IAAI,CAACP,6BAA6B,GAChC,IAAI,CAAChB,mBAAmB,CAAC,MAAA,CAAO,CAACuB,UAAU,IAC3C,IAAI,CAACvB,mBAAmB,CAAC,OAAQ,CAAA,CAACuB,UAAU,IAC5C,IAAI,CAACvB,mBAAmB,CAAC,SAAU,CAAA,CAACuB,UAAU;AAClD;IACAc,eAAgBC,CAAAA,MAAqB,EAAEC,SAAiB,EAAE;AACxD,QAAA,OAAO,IAAI,CAACvC,mBAAmB,CAACsC,OAAO,GAAG,IAAI,CAACtC,mBAAmB,CAACsC,MAAAA,CAAO,CAACT,IAAI,GAAGU,SAAY,GAAA,CAAA;AAChG;AACAC,IAAAA,oBAAAA,CAAqBF,MAAqB,EAAsC;AAC9E,QAAA,OAAO,IAAI,CAACtC,mBAAmB,CAACsC,MAAO,CAAA;AACzC;AACF;;;;"}
|
|
@@ -88,12 +88,12 @@ class WebGPURenderPass {
|
|
|
88
88
|
const vy = this._device.screenYToDevice(this._currentViewport.y);
|
|
89
89
|
const vw = this._device.screenXToDevice(this._currentViewport.width);
|
|
90
90
|
const vh = this._device.screenYToDevice(this._currentViewport.height);
|
|
91
|
-
/*
|
|
92
|
-
if (vx < 0 || vy < 0 || vw > this._device.drawingBufferWidth || vh > this._device.drawingBufferHeight) {
|
|
93
|
-
console.error(
|
|
94
|
-
`** VIEWPORT ERROR **: (${vx}, ${vy}, ${vw}, ${vh}) => (0, 0, ${this._device.drawingBufferWidth}, ${this._device.drawingBufferHeight})`
|
|
95
|
-
);
|
|
96
|
-
}
|
|
91
|
+
/*
|
|
92
|
+
if (vx < 0 || vy < 0 || vw > this._device.drawingBufferWidth || vh > this._device.drawingBufferHeight) {
|
|
93
|
+
console.error(
|
|
94
|
+
`** VIEWPORT ERROR **: (${vx}, ${vy}, ${vw}, ${vh}) => (0, 0, ${this._device.drawingBufferWidth}, ${this._device.drawingBufferHeight})`
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
97
|
*/ if (this._renderPassEncoder) {
|
|
98
98
|
this._renderPassEncoder.setViewport(vx, this._device.drawingBufferHeight - vy - vh, vw, vh, 0, 1);
|
|
99
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderpass_webgpu.js","sources":["../src/renderpass_webgpu.ts"],"sourcesContent":["import type { Immutable, Nullable, TypedArray, Vector4 } from '@zephyr3d/base';\nimport type { PrimitiveType, DeviceViewport } from '@zephyr3d/device';\nimport {\n hasStencilChannel,\n PBPrimitiveTypeInfo,\n PBPrimitiveType,\n isIntegerTextureFormat,\n isSignedTextureFormat\n} from '@zephyr3d/device';\nimport type { WebGPUProgram } from './gpuprogram_webgpu';\nimport type { WebGPURenderStateSet } from './renderstates_webgpu';\nimport type { WebGPUBindGroup } from './bindgroup_webgpu';\nimport type { WebGPUBaseTexture } from './basetexture_webgpu';\nimport type { WebGPUDevice } from './device';\nimport type { WebGPUFrameBuffer } from './framebuffer_webgpu';\nimport type { WebGPUVertexLayout } from './vertexlayout_webgpu';\nimport type { WebGPUIndexBuffer } from './indexbuffer_webgpu';\nimport type { FrameBufferInfo } from './pipeline_cache';\nimport { textureFormatInvMap } from './constants_webgpu';\nimport { WebGPUClearQuad } from './utils_webgpu';\n\nconst VALIDATION_NEED_NEW_PASS = 1 << 0;\nconst VALIDATION_FAILED = 1 << 1;\n\nconst typeU16 = PBPrimitiveTypeInfo.getCachedTypeInfo(PBPrimitiveType.U16);\n\nexport class WebGPURenderPass {\n private readonly _device: WebGPUDevice;\n private _renderCommandEncoder: Nullable<GPUCommandEncoder>;\n private _renderPassEncoder: Nullable<GPURenderPassEncoder>;\n private _fbBindFlag: Nullable<number>;\n private _currentViewport: Nullable<DeviceViewport>;\n private _currentScissor: Nullable<DeviceViewport>;\n private _frameBufferInfo: FrameBufferInfo;\n constructor(device: WebGPUDevice) {\n this._device = device;\n this._renderCommandEncoder = null;\n this._renderPassEncoder = null;\n this._fbBindFlag = null;\n this._currentViewport = null;\n this._currentScissor = null;\n this._frameBufferInfo = this.createFrameBufferInfo(null);\n }\n get active() {\n return !!this._renderPassEncoder;\n }\n private createFrameBufferInfo(fb: Nullable<WebGPUFrameBuffer>) {\n const info: FrameBufferInfo = !fb\n ? {\n frameBuffer: null,\n colorFormats: [this._device.backbufferFormat],\n depthFormat: this._device.backbufferDepthFormat,\n sampleCount: this._device.sampleCount,\n hash: null,\n clearHash: 'f'\n }\n : {\n frameBuffer: fb,\n colorFormats: fb.getColorAttachments().map((val) => (val as WebGPUBaseTexture).gpuFormat!),\n depthFormat: (fb.getDepthAttachment() as WebGPUBaseTexture)?.gpuFormat!,\n sampleCount: fb.getOptions().sampleCount ?? 1,\n hash: null,\n clearHash: fb\n .getColorAttachments()\n .map((val) => {\n const fmt = textureFormatInvMap[(val as WebGPUBaseTexture).gpuFormat!];\n return isIntegerTextureFormat(fmt) ? (isSignedTextureFormat(fmt) ? 'i' : 'u') : 'f';\n })\n .join('')\n };\n info.hash = `${info.colorFormats.join('-')}:${info.depthFormat}:${info.sampleCount}`;\n return info;\n }\n setFramebuffer(fb: WebGPUFrameBuffer) {\n if (this._frameBufferInfo.frameBuffer !== fb) {\n this.end();\n this._frameBufferInfo = this.createFrameBufferInfo(fb);\n this.setViewport(null);\n this.setScissor(null);\n }\n }\n getFramebuffer() {\n return this._frameBufferInfo.frameBuffer;\n }\n setViewport(vp: Nullable<Immutable<number[] | DeviceViewport>>) {\n if (!vp || (!Array.isArray(vp) && (vp as DeviceViewport).default)) {\n this._currentViewport = {\n x: 0,\n y: 0,\n width: this._device.deviceXToScreen(this._device.drawingBufferWidth),\n height: this._device.deviceYToScreen(this._device.drawingBufferHeight),\n default: true\n };\n } else {\n if (Array.isArray(vp)) {\n this._currentViewport = {\n x: vp[0],\n y: vp[1],\n width: vp[2],\n height: vp[3],\n default: false\n };\n } else {\n this._currentViewport = Object.assign({ default: false }, vp as DeviceViewport);\n }\n }\n const vx = this._device.screenXToDevice(this._currentViewport.x);\n const vy = this._device.screenYToDevice(this._currentViewport.y);\n const vw = this._device.screenXToDevice(this._currentViewport.width);\n const vh = this._device.screenYToDevice(this._currentViewport.height);\n /*\n if (vx < 0 || vy < 0 || vw > this._device.drawingBufferWidth || vh > this._device.drawingBufferHeight) {\n console.error(\n `** VIEWPORT ERROR **: (${vx}, ${vy}, ${vw}, ${vh}) => (0, 0, ${this._device.drawingBufferWidth}, ${this._device.drawingBufferHeight})`\n );\n }\n */\n if (this._renderPassEncoder) {\n this._renderPassEncoder.setViewport(vx, this._device.drawingBufferHeight - vy - vh, vw, vh, 0, 1);\n }\n }\n getViewport() {\n return Object.assign({}, this._currentViewport);\n }\n setScissor(scissor: Nullable<Immutable<number[] | DeviceViewport>>) {\n const backBufferWidth = this._device.deviceXToScreen(this._device.drawingBufferWidth);\n const backBufferHeight = this._device.deviceYToScreen(this._device.drawingBufferHeight);\n if (\n scissor === null ||\n scissor === undefined ||\n (!Array.isArray(scissor) && (scissor as DeviceViewport).default)\n ) {\n this._currentScissor = {\n x: 0,\n y: 0,\n width: backBufferWidth,\n height: backBufferHeight,\n default: true\n };\n } else {\n if (Array.isArray(scissor)) {\n this._currentScissor = {\n x: scissor[0],\n y: scissor[1],\n width: scissor[2],\n height: scissor[3],\n default: false\n };\n } else {\n this._currentScissor = Object.assign({ default: false }, scissor as DeviceViewport);\n }\n }\n let vx = this._device.screenXToDevice(this._currentScissor.x);\n let vy = this._device.screenYToDevice(this._currentScissor.y);\n let vw = this._device.screenXToDevice(this._currentScissor.width);\n let vh = this._device.screenYToDevice(this._currentScissor.height);\n // Clip scissor region to screen\n if (vx < 0) {\n vw += vx;\n vx = 0;\n }\n if (vy < 0) {\n vh += vy;\n vy = 0;\n }\n vw = Math.min(this._device.screenXToDevice(backBufferWidth) - vx, vw);\n vh = Math.min(this._device.screenYToDevice(backBufferHeight) - vy, vh);\n if (vw < 0 || vh < 0) {\n vx = 0;\n vy = 0;\n vw = 0;\n vh = 0;\n }\n if (this._renderPassEncoder) {\n this._renderPassEncoder.setScissorRect(vx, this._device.drawingBufferHeight - vy - vh, vw, vh);\n }\n }\n getScissor() {\n return Object.assign({}, this._currentScissor);\n }\n executeRenderBundle(renderBundle: GPURenderBundle) {\n if (!this.active) {\n this.begin();\n }\n this._renderPassEncoder!.executeBundles([renderBundle]);\n }\n draw(\n program: WebGPUProgram,\n vertexData: Nullable<WebGPUVertexLayout>,\n stateSet: WebGPURenderStateSet,\n bindGroups: WebGPUBindGroup[],\n bindGroupOffsets: Nullable<Nullable<Iterable<number>>[]>,\n primitiveType: PrimitiveType,\n first: number,\n count: number,\n numInstances: number\n ) {\n const validation = this.validateDraw(\n program,\n bindGroups,\n stateSet,\n primitiveType,\n first,\n count,\n numInstances\n );\n if (validation & VALIDATION_FAILED) {\n return;\n }\n if (validation & VALIDATION_NEED_NEW_PASS) {\n this.end();\n }\n if (!this.active) {\n this.begin();\n }\n this.drawInternal(\n this._renderPassEncoder!,\n program,\n vertexData,\n stateSet,\n bindGroups,\n bindGroupOffsets,\n primitiveType,\n first,\n count,\n numInstances\n );\n }\n clear(color: Nullable<Vector4>, depth: Nullable<number>, stencil: Nullable<number>) {\n if (!this._currentScissor) {\n this.end();\n this.begin(color, depth, stencil);\n } else {\n if (!this._renderPassEncoder) {\n this.begin();\n }\n this._renderPassEncoder!.insertDebugMarker('clear');\n WebGPUClearQuad.drawClearQuad(this, color, depth, stencil);\n this._renderPassEncoder!.insertDebugMarker('end clear');\n }\n }\n getDevice() {\n return this._device;\n }\n getFrameBufferInfo() {\n return this._frameBufferInfo;\n }\n begin(color?: Nullable<TypedArray>, depth?: Nullable<number>, stencil?: Nullable<number>) {\n if (this.active) {\n console.error('WebGPURenderPass.begin() failed: begin() has already been called');\n return;\n }\n this._renderCommandEncoder = this._device.commandQueue.getEncoder();\n const frameBuffer = this._frameBufferInfo.frameBuffer;\n if (!frameBuffer) {\n const mainPassDesc = this._device.defaultRenderPassDesc;\n const colorAttachmentDesc = (\n this._device.defaultRenderPassDesc.colorAttachments as GPURenderPassColorAttachment[]\n )[0];\n if (this._frameBufferInfo.sampleCount > 1) {\n colorAttachmentDesc.resolveTarget = this._device.context!.getCurrentTexture().createView();\n } else {\n colorAttachmentDesc.view = this._device.context!.getCurrentTexture().createView();\n }\n colorAttachmentDesc.loadOp = color ? 'clear' : 'load';\n // TODO: GPUColor type in @webgpu/types conficts with lib.dom,use `any` type to make ts-server happy\n colorAttachmentDesc.clearValue = (color as any) ?? undefined;\n const depthAttachmentDesc = this._device.defaultRenderPassDesc.depthStencilAttachment;\n depthAttachmentDesc!.depthLoadOp = typeof depth === 'number' ? 'clear' : 'load';\n depthAttachmentDesc!.depthClearValue = depth ?? undefined;\n depthAttachmentDesc!.stencilLoadOp = typeof stencil === 'number' ? 'clear' : 'load';\n depthAttachmentDesc!.stencilClearValue = stencil ?? undefined;\n this._renderPassEncoder = this._renderCommandEncoder.beginRenderPass(mainPassDesc);\n } else {\n const depthAttachmentTexture = frameBuffer.getDepthAttachment() as WebGPUBaseTexture;\n let depthTextureView: GPUTextureView;\n if (depthAttachmentTexture) {\n depthAttachmentTexture._markAsCurrentFB(true);\n const attachment = frameBuffer.getOptions().depthAttachment;\n const layer =\n depthAttachmentTexture.isTexture2DArray() || depthAttachmentTexture.isTexture3D()\n ? attachment!.layer\n : depthAttachmentTexture.isTextureCube()\n ? attachment!.face\n : 0;\n depthTextureView = depthAttachmentTexture.getView(0, layer ?? 0, 1);\n }\n this._fbBindFlag = frameBuffer.bindFlag;\n\n const passDesc: GPURenderPassDescriptor = {\n label: `customRenderPass:${this._frameBufferInfo.hash}`,\n colorAttachments:\n frameBuffer.getOptions().colorAttachments?.map((attachment, index) => {\n const tex = attachment.texture as WebGPUBaseTexture;\n if (tex) {\n tex._markAsCurrentFB(true);\n const layer =\n tex.isTexture2DArray() || tex.isTexture3D()\n ? attachment.layer\n : tex.isTextureCube()\n ? attachment.face\n : 0;\n if (frameBuffer.getOptions().sampleCount === 1) {\n return {\n view: tex.getView(attachment.level ?? 0, layer ?? 0, 1),\n loadOp: color ? 'clear' : 'load',\n clearValue: color,\n storeOp: 'store'\n } as GPURenderPassColorAttachment;\n } else {\n const msaaTexture = frameBuffer.getMSAAColorAttacments()![index];\n const msaaView = this._device.gpuCreateTextureView(msaaTexture, {\n dimension: '2d',\n baseMipLevel: attachment.level ?? 0,\n mipLevelCount: 1,\n baseArrayLayer: 0,\n arrayLayerCount: 1\n });\n return {\n view: msaaView,\n resolveTarget: tex.getView(attachment.level ?? 0, layer ?? 0, 1),\n loadOp: color ? 'clear' : 'load',\n clearValue: color,\n storeOp: 'store'\n } as GPURenderPassColorAttachment;\n }\n } else {\n return null;\n }\n }) ?? [],\n depthStencilAttachment: depthAttachmentTexture\n ? frameBuffer.getOptions().sampleCount === 1\n ? {\n view: depthTextureView!,\n depthLoadOp: typeof depth === 'number' ? 'clear' : 'load',\n depthClearValue: depth ?? undefined,\n depthStoreOp: 'store',\n stencilLoadOp: hasStencilChannel(depthAttachmentTexture.format)\n ? typeof stencil === 'number'\n ? 'clear'\n : 'load'\n : undefined,\n stencilClearValue: stencil ?? undefined,\n stencilStoreOp: hasStencilChannel(depthAttachmentTexture.format) ? 'store' : undefined\n }\n : {\n view: frameBuffer.getMSAADepthAttachment()!.createView(),\n depthLoadOp: typeof depth === 'number' ? 'clear' : 'load',\n depthClearValue: depth ?? undefined,\n depthStoreOp: 'store',\n stencilLoadOp: hasStencilChannel(depthAttachmentTexture.format)\n ? typeof stencil === 'number'\n ? 'clear'\n : 'load'\n : undefined,\n stencilClearValue: stencil ?? undefined,\n stencilStoreOp: hasStencilChannel(depthAttachmentTexture.format) ? 'store' : undefined\n }\n : undefined\n };\n this._renderPassEncoder = this._renderCommandEncoder.beginRenderPass(passDesc);\n }\n this.setViewport(this._currentViewport);\n this.setScissor(this._currentScissor);\n }\n end() {\n if (!this.active) {\n return;\n }\n // finish current render pass command\n if (this._renderPassEncoder) {\n this._renderPassEncoder.end();\n this._renderPassEncoder = null;\n }\n this._renderCommandEncoder = null;\n // unmark render target flags and generate render target mipmaps if needed\n if (this._frameBufferInfo.frameBuffer) {\n const options = this._frameBufferInfo.frameBuffer.getOptions();\n if (options.colorAttachments) {\n for (const attachment of options.colorAttachments) {\n (attachment.texture as WebGPUBaseTexture)._markAsCurrentFB(false);\n if (attachment.generateMipmaps && attachment.texture.mipLevelCount > 1) {\n attachment.texture.generateMipmaps();\n }\n }\n }\n (options.depthAttachment?.texture as WebGPUBaseTexture)?._markAsCurrentFB(false);\n }\n }\n capture(\n renderBundleEncoder: GPURenderBundleEncoder,\n program: WebGPUProgram,\n vertexData: WebGPUVertexLayout,\n stateSet: WebGPURenderStateSet,\n bindGroups: WebGPUBindGroup[],\n bindGroupOffsets: Nullable<Iterable<number>>[],\n primitiveType: PrimitiveType,\n first: number,\n count: number,\n numInstances: number\n ) {\n const validation = this.validateDraw(\n program,\n bindGroups,\n stateSet,\n primitiveType,\n first,\n count,\n numInstances\n );\n if (validation & VALIDATION_FAILED) {\n return;\n }\n this.drawInternal(\n this._renderPassEncoder!,\n program,\n vertexData,\n stateSet,\n bindGroups,\n bindGroupOffsets,\n primitiveType,\n first,\n count,\n numInstances,\n renderBundleEncoder\n );\n }\n private drawInternal(\n renderPassEncoder: GPURenderPassEncoder,\n program: WebGPUProgram,\n vertexData: Nullable<WebGPUVertexLayout>,\n stateSet: WebGPURenderStateSet,\n bindGroups: WebGPUBindGroup[],\n bindGroupOffsets: Nullable<Nullable<Iterable<number>>[]>,\n primitiveType: PrimitiveType,\n first: number,\n count: number,\n numInstances: number,\n renderBundleEncoder?: GPURenderBundleEncoder\n ) {\n if (\n this.setBindGroupsForRender(\n renderPassEncoder,\n program,\n bindGroups,\n bindGroupOffsets,\n renderBundleEncoder\n )\n ) {\n const pipeline = this._device.pipelineCache.fetchRenderPipeline(\n program,\n vertexData,\n stateSet,\n primitiveType,\n this._frameBufferInfo\n );\n if (pipeline) {\n renderPassEncoder.setPipeline(pipeline);\n renderBundleEncoder?.setPipeline(pipeline);\n const stencilState = stateSet?.stencilState;\n if (stencilState) {\n renderPassEncoder.setStencilReference(stencilState.ref);\n }\n if (vertexData) {\n const vertexBuffers = vertexData.getLayouts(program.vertexAttributes)?.buffers;\n vertexBuffers?.forEach((val, index) => {\n renderPassEncoder.setVertexBuffer(index, val.buffer.object as GPUBuffer, val.drawOffset);\n renderBundleEncoder?.setVertexBuffer(index, val.buffer.object as GPUBuffer, val.drawOffset);\n });\n const indexBuffer = vertexData.getIndexBuffer() as unknown as WebGPUIndexBuffer;\n if (indexBuffer) {\n renderPassEncoder.setIndexBuffer(\n indexBuffer.object!,\n indexBuffer.indexType === typeU16 ? 'uint16' : 'uint32'\n );\n renderBundleEncoder?.setIndexBuffer(\n indexBuffer.object!,\n indexBuffer.indexType === typeU16 ? 'uint16' : 'uint32'\n );\n renderPassEncoder.drawIndexed(count, numInstances, first);\n renderBundleEncoder?.drawIndexed(count, numInstances, first);\n } else {\n renderPassEncoder.draw(count, numInstances, first);\n renderBundleEncoder?.draw(count, numInstances, first);\n }\n } else {\n renderPassEncoder.draw(count, numInstances, first);\n renderBundleEncoder?.draw(count, numInstances, first);\n }\n }\n }\n }\n private validateDraw(\n program: WebGPUProgram,\n bindGroups: WebGPUBindGroup[],\n stateSet: WebGPURenderStateSet,\n primitiveType: PrimitiveType,\n first: number,\n count: number,\n numInstances: number\n ) {\n let validation = 0;\n const colorTargetCount = this._frameBufferInfo.colorFormats.length;\n if (colorTargetCount !== 0 && program.fragmentOutputCount !== colorTargetCount) {\n if (\n !stateSet?.colorState ||\n stateSet.colorState.redMask ||\n stateSet.colorState.greenMask ||\n stateSet.colorState.blueMask ||\n stateSet.colorState.alphaMask\n ) {\n const framebuffer = this._frameBufferInfo.frameBuffer;\n const colorAttachments = framebuffer?.getColorAttachments().map((texture, index) => ({\n index,\n name: texture?.name,\n uid: texture?.uid,\n format: texture?.format\n })) ?? [{ index: 0, name: '<backbuffer>', uid: 0, format: this._frameBufferInfo.colorFormats[0] }];\n console.error('WebGPU draw validation failed: fragment color output count mismatch', {\n programName: program.name,\n programLabel: program.label,\n programHash: program.hash,\n fragmentOutputCount: program.fragmentOutputCount,\n colorTargetCount,\n colorFormats: this._frameBufferInfo.colorFormats,\n depthFormat: this._frameBufferInfo.depthFormat,\n framebufferName: framebuffer?.name ?? '<backbuffer>',\n framebufferHash: this._frameBufferInfo.hash,\n colorAttachments,\n primitiveType,\n first,\n count,\n numInstances,\n stack: new Error().stack\n });\n validation |= VALIDATION_FAILED;\n }\n }\n if (bindGroups) {\n for (let i = 0; i < program.bindGroupLayouts.length; i++) {\n const bindGroup = bindGroups[i];\n if (bindGroup) {\n if (bindGroup.bindGroup) {\n for (const ubo of bindGroup.bufferList) {\n if (ubo.disposed) {\n validation |= VALIDATION_FAILED;\n }\n }\n for (const tex of bindGroup.textureList) {\n if (tex.disposed) {\n validation |= VALIDATION_FAILED;\n }\n if (tex._isMarkedAsCurrentFB()) {\n console.error('bind resource texture can not be current render target');\n validation |= VALIDATION_FAILED;\n }\n }\n }\n } else {\n console.error(`Missing bind group (${i}) when drawing with program '${program.name}'`);\n return VALIDATION_FAILED;\n }\n }\n }\n if (\n this._frameBufferInfo.frameBuffer &&\n this._frameBufferInfo.frameBuffer.bindFlag !== this._fbBindFlag\n ) {\n validation |= VALIDATION_NEED_NEW_PASS;\n }\n return validation;\n }\n private setBindGroupsForRender(\n renderPassEncoder: GPURenderPassEncoder,\n program: WebGPUProgram,\n bindGroups: WebGPUBindGroup[],\n bindGroupOffsets: Nullable<Nullable<Iterable<number>>[]>,\n renderBundleEncoder?: GPURenderBundleEncoder\n ) {\n if (bindGroups) {\n for (let i = 0; i < 4; i++) {\n if (i < program.bindGroupLayouts.length) {\n const bindGroup = bindGroups[i].bindGroup;\n if (!bindGroup) {\n return false;\n }\n const bindGroupOffset = bindGroups[i].getDynamicOffsets() ?? bindGroupOffsets?.[i];\n if (bindGroupOffset) {\n renderPassEncoder.setBindGroup(i, bindGroup, bindGroupOffset);\n renderBundleEncoder?.setBindGroup(i, bindGroup, bindGroupOffset);\n } else {\n renderPassEncoder.setBindGroup(i, bindGroup);\n renderBundleEncoder?.setBindGroup(i, bindGroup);\n }\n } else {\n renderPassEncoder.setBindGroup(i, this._device.emptyBindGroup);\n renderBundleEncoder?.setBindGroup(i, this._device.emptyBindGroup);\n }\n }\n }\n return true;\n }\n}\n"],"names":["VALIDATION_NEED_NEW_PASS","VALIDATION_FAILED","typeU16","PBPrimitiveTypeInfo","getCachedTypeInfo","PBPrimitiveType","U16","WebGPURenderPass","_device","_renderCommandEncoder","_renderPassEncoder","_fbBindFlag","_currentViewport","_currentScissor","_frameBufferInfo","device","createFrameBufferInfo","active","fb","info","frameBuffer","colorFormats","backbufferFormat","depthFormat","backbufferDepthFormat","sampleCount","hash","clearHash","getColorAttachments","map","val","gpuFormat","getDepthAttachment","getOptions","fmt","textureFormatInvMap","isIntegerTextureFormat","isSignedTextureFormat","join","setFramebuffer","end","setViewport","setScissor","getFramebuffer","vp","Array","isArray","default","x","y","width","deviceXToScreen","drawingBufferWidth","height","deviceYToScreen","drawingBufferHeight","Object","assign","vx","screenXToDevice","vy","screenYToDevice","vw","vh","getViewport","scissor","backBufferWidth","backBufferHeight","undefined","Math","min","setScissorRect","getScissor","executeRenderBundle","renderBundle","begin","executeBundles","draw","program","vertexData","stateSet","bindGroups","bindGroupOffsets","primitiveType","first","count","numInstances","validation","validateDraw","drawInternal","clear","color","depth","stencil","insertDebugMarker","WebGPUClearQuad","drawClearQuad","getDevice","getFrameBufferInfo","console","error","commandQueue","getEncoder","mainPassDesc","defaultRenderPassDesc","colorAttachmentDesc","colorAttachments","resolveTarget","context","getCurrentTexture","createView","view","loadOp","clearValue","depthAttachmentDesc","depthStencilAttachment","depthLoadOp","depthClearValue","stencilLoadOp","stencilClearValue","beginRenderPass","depthAttachmentTexture","depthTextureView","_markAsCurrentFB","attachment","depthAttachment","layer","isTexture2DArray","isTexture3D","isTextureCube","face","getView","bindFlag","passDesc","label","index","tex","texture","level","storeOp","msaaTexture","getMSAAColorAttacments","msaaView","gpuCreateTextureView","dimension","baseMipLevel","mipLevelCount","baseArrayLayer","arrayLayerCount","depthStoreOp","hasStencilChannel","format","stencilStoreOp","getMSAADepthAttachment","options","generateMipmaps","capture","renderBundleEncoder","renderPassEncoder","setBindGroupsForRender","pipeline","pipelineCache","fetchRenderPipeline","setPipeline","stencilState","setStencilReference","ref","vertexBuffers","getLayouts","vertexAttributes","buffers","forEach","setVertexBuffer","buffer","object","drawOffset","indexBuffer","getIndexBuffer","setIndexBuffer","indexType","drawIndexed","colorTargetCount","length","fragmentOutputCount","colorState","redMask","greenMask","blueMask","alphaMask","framebuffer","name","uid","programName","programLabel","programHash","framebufferName","framebufferHash","stack","Error","i","bindGroupLayouts","bindGroup","ubo","bufferList","disposed","textureList","_isMarkedAsCurrentFB","bindGroupOffset","getDynamicOffsets","setBindGroup","emptyBindGroup"],"mappings":";;;;AAqBA,MAAMA,2BAA2B,CAAK,IAAA,CAAA;AACtC,MAAMC,oBAAoB,CAAK,IAAA,CAAA;AAE/B,MAAMC,OAAUC,GAAAA,mBAAAA,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IAAIsH,CAAAA,GAAI,CAAGA,EAAAA,CAAAA,GAAI,GAAGA,CAAK,EAAA,CAAA;AAC1B,gBAAA,IAAIA,CAAIzH,GAAAA,OAAAA,CAAQ0H,gBAAgB,CAAClB,MAAM,EAAE;AACvC,oBAAA,MAAMmB,SAAYxH,GAAAA,UAAU,CAACsH,CAAAA,CAAE,CAACE,SAAS;AACzC,oBAAA,IAAI,CAACA,SAAW,EAAA;wBACd,OAAO,KAAA;AACT;oBACA,MAAMM,eAAAA,GAAkB9H,UAAU,CAACsH,CAAAA,CAAE,CAACS,iBAAiB,EAAA,IAAM9H,gBAAkB,GAACqH,CAAE,CAAA;AAClF,oBAAA,IAAIQ,eAAiB,EAAA;wBACnBjD,iBAAkBmD,CAAAA,YAAY,CAACV,CAAAA,EAAGE,SAAWM,EAAAA,eAAAA,CAAAA;wBAC7ClD,mBAAqBoD,EAAAA,YAAAA,CAAaV,GAAGE,SAAWM,EAAAA,eAAAA,CAAAA;qBAC3C,MAAA;wBACLjD,iBAAkBmD,CAAAA,YAAY,CAACV,CAAGE,EAAAA,SAAAA,CAAAA;AAClC5C,wBAAAA,mBAAAA,EAAqBoD,aAAaV,CAAGE,EAAAA,SAAAA,CAAAA;AACvC;iBACK,MAAA;AACL3C,oBAAAA,iBAAAA,CAAkBmD,YAAY,CAACV,CAAAA,EAAG,IAAI,CAAC/L,OAAO,CAAC0M,cAAc,CAAA;AAC7DrD,oBAAAA,mBAAAA,EAAqBoD,aAAaV,CAAG,EAAA,IAAI,CAAC/L,OAAO,CAAC0M,cAAc,CAAA;AAClE;AACF;AACF;QACA,OAAO,IAAA;AACT;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"renderpass_webgpu.js","sources":["../src/renderpass_webgpu.ts"],"sourcesContent":["import type { Immutable, Nullable, TypedArray, Vector4 } from '@zephyr3d/base';\r\nimport type { PrimitiveType, DeviceViewport } from '@zephyr3d/device';\r\nimport {\r\n hasStencilChannel,\r\n PBPrimitiveTypeInfo,\r\n PBPrimitiveType,\r\n isIntegerTextureFormat,\r\n isSignedTextureFormat\r\n} from '@zephyr3d/device';\r\nimport type { WebGPUProgram } from './gpuprogram_webgpu';\r\nimport type { WebGPURenderStateSet } from './renderstates_webgpu';\r\nimport type { WebGPUBindGroup } from './bindgroup_webgpu';\r\nimport type { WebGPUBaseTexture } from './basetexture_webgpu';\r\nimport type { WebGPUDevice } from './device';\r\nimport type { WebGPUFrameBuffer } from './framebuffer_webgpu';\r\nimport type { WebGPUVertexLayout } from './vertexlayout_webgpu';\r\nimport type { WebGPUIndexBuffer } from './indexbuffer_webgpu';\r\nimport type { FrameBufferInfo } from './pipeline_cache';\r\nimport { textureFormatInvMap } from './constants_webgpu';\r\nimport { WebGPUClearQuad } from './utils_webgpu';\r\n\r\nconst VALIDATION_NEED_NEW_PASS = 1 << 0;\r\nconst VALIDATION_FAILED = 1 << 1;\r\n\r\nconst typeU16 = PBPrimitiveTypeInfo.getCachedTypeInfo(PBPrimitiveType.U16);\r\n\r\nexport class WebGPURenderPass {\r\n private readonly _device: WebGPUDevice;\r\n private _renderCommandEncoder: Nullable<GPUCommandEncoder>;\r\n private _renderPassEncoder: Nullable<GPURenderPassEncoder>;\r\n private _fbBindFlag: Nullable<number>;\r\n private _currentViewport: Nullable<DeviceViewport>;\r\n private _currentScissor: Nullable<DeviceViewport>;\r\n private _frameBufferInfo: FrameBufferInfo;\r\n constructor(device: WebGPUDevice) {\r\n this._device = device;\r\n this._renderCommandEncoder = null;\r\n this._renderPassEncoder = null;\r\n this._fbBindFlag = null;\r\n this._currentViewport = null;\r\n this._currentScissor = null;\r\n this._frameBufferInfo = this.createFrameBufferInfo(null);\r\n }\r\n get active() {\r\n return !!this._renderPassEncoder;\r\n }\r\n private createFrameBufferInfo(fb: Nullable<WebGPUFrameBuffer>) {\r\n const info: FrameBufferInfo = !fb\r\n ? {\r\n frameBuffer: null,\r\n colorFormats: [this._device.backbufferFormat],\r\n depthFormat: this._device.backbufferDepthFormat,\r\n sampleCount: this._device.sampleCount,\r\n hash: null,\r\n clearHash: 'f'\r\n }\r\n : {\r\n frameBuffer: fb,\r\n colorFormats: fb.getColorAttachments().map((val) => (val as WebGPUBaseTexture).gpuFormat!),\r\n depthFormat: (fb.getDepthAttachment() as WebGPUBaseTexture)?.gpuFormat!,\r\n sampleCount: fb.getOptions().sampleCount ?? 1,\r\n hash: null,\r\n clearHash: fb\r\n .getColorAttachments()\r\n .map((val) => {\r\n const fmt = textureFormatInvMap[(val as WebGPUBaseTexture).gpuFormat!];\r\n return isIntegerTextureFormat(fmt) ? (isSignedTextureFormat(fmt) ? 'i' : 'u') : 'f';\r\n })\r\n .join('')\r\n };\r\n info.hash = `${info.colorFormats.join('-')}:${info.depthFormat}:${info.sampleCount}`;\r\n return info;\r\n }\r\n setFramebuffer(fb: WebGPUFrameBuffer) {\r\n if (this._frameBufferInfo.frameBuffer !== fb) {\r\n this.end();\r\n this._frameBufferInfo = this.createFrameBufferInfo(fb);\r\n this.setViewport(null);\r\n this.setScissor(null);\r\n }\r\n }\r\n getFramebuffer() {\r\n return this._frameBufferInfo.frameBuffer;\r\n }\r\n setViewport(vp: Nullable<Immutable<number[] | DeviceViewport>>) {\r\n if (!vp || (!Array.isArray(vp) && (vp as DeviceViewport).default)) {\r\n this._currentViewport = {\r\n x: 0,\r\n y: 0,\r\n width: this._device.deviceXToScreen(this._device.drawingBufferWidth),\r\n height: this._device.deviceYToScreen(this._device.drawingBufferHeight),\r\n default: true\r\n };\r\n } else {\r\n if (Array.isArray(vp)) {\r\n this._currentViewport = {\r\n x: vp[0],\r\n y: vp[1],\r\n width: vp[2],\r\n height: vp[3],\r\n default: false\r\n };\r\n } else {\r\n this._currentViewport = Object.assign({ default: false }, vp as DeviceViewport);\r\n }\r\n }\r\n const vx = this._device.screenXToDevice(this._currentViewport.x);\r\n const vy = this._device.screenYToDevice(this._currentViewport.y);\r\n const vw = this._device.screenXToDevice(this._currentViewport.width);\r\n const vh = this._device.screenYToDevice(this._currentViewport.height);\r\n /*\r\n if (vx < 0 || vy < 0 || vw > this._device.drawingBufferWidth || vh > this._device.drawingBufferHeight) {\r\n console.error(\r\n `** VIEWPORT ERROR **: (${vx}, ${vy}, ${vw}, ${vh}) => (0, 0, ${this._device.drawingBufferWidth}, ${this._device.drawingBufferHeight})`\r\n );\r\n }\r\n */\r\n if (this._renderPassEncoder) {\r\n this._renderPassEncoder.setViewport(vx, this._device.drawingBufferHeight - vy - vh, vw, vh, 0, 1);\r\n }\r\n }\r\n getViewport() {\r\n return Object.assign({}, this._currentViewport);\r\n }\r\n setScissor(scissor: Nullable<Immutable<number[] | DeviceViewport>>) {\r\n const backBufferWidth = this._device.deviceXToScreen(this._device.drawingBufferWidth);\r\n const backBufferHeight = this._device.deviceYToScreen(this._device.drawingBufferHeight);\r\n if (\r\n scissor === null ||\r\n scissor === undefined ||\r\n (!Array.isArray(scissor) && (scissor as DeviceViewport).default)\r\n ) {\r\n this._currentScissor = {\r\n x: 0,\r\n y: 0,\r\n width: backBufferWidth,\r\n height: backBufferHeight,\r\n default: true\r\n };\r\n } else {\r\n if (Array.isArray(scissor)) {\r\n this._currentScissor = {\r\n x: scissor[0],\r\n y: scissor[1],\r\n width: scissor[2],\r\n height: scissor[3],\r\n default: false\r\n };\r\n } else {\r\n this._currentScissor = Object.assign({ default: false }, scissor as DeviceViewport);\r\n }\r\n }\r\n let vx = this._device.screenXToDevice(this._currentScissor.x);\r\n let vy = this._device.screenYToDevice(this._currentScissor.y);\r\n let vw = this._device.screenXToDevice(this._currentScissor.width);\r\n let vh = this._device.screenYToDevice(this._currentScissor.height);\r\n // Clip scissor region to screen\r\n if (vx < 0) {\r\n vw += vx;\r\n vx = 0;\r\n }\r\n if (vy < 0) {\r\n vh += vy;\r\n vy = 0;\r\n }\r\n vw = Math.min(this._device.screenXToDevice(backBufferWidth) - vx, vw);\r\n vh = Math.min(this._device.screenYToDevice(backBufferHeight) - vy, vh);\r\n if (vw < 0 || vh < 0) {\r\n vx = 0;\r\n vy = 0;\r\n vw = 0;\r\n vh = 0;\r\n }\r\n if (this._renderPassEncoder) {\r\n this._renderPassEncoder.setScissorRect(vx, this._device.drawingBufferHeight - vy - vh, vw, vh);\r\n }\r\n }\r\n getScissor() {\r\n return Object.assign({}, this._currentScissor);\r\n }\r\n executeRenderBundle(renderBundle: GPURenderBundle) {\r\n if (!this.active) {\r\n this.begin();\r\n }\r\n this._renderPassEncoder!.executeBundles([renderBundle]);\r\n }\r\n draw(\r\n program: WebGPUProgram,\r\n vertexData: Nullable<WebGPUVertexLayout>,\r\n stateSet: WebGPURenderStateSet,\r\n bindGroups: WebGPUBindGroup[],\r\n bindGroupOffsets: Nullable<Nullable<Iterable<number>>[]>,\r\n primitiveType: PrimitiveType,\r\n first: number,\r\n count: number,\r\n numInstances: number\r\n ) {\r\n const validation = this.validateDraw(\r\n program,\r\n bindGroups,\r\n stateSet,\r\n primitiveType,\r\n first,\r\n count,\r\n numInstances\r\n );\r\n if (validation & VALIDATION_FAILED) {\r\n return;\r\n }\r\n if (validation & VALIDATION_NEED_NEW_PASS) {\r\n this.end();\r\n }\r\n if (!this.active) {\r\n this.begin();\r\n }\r\n this.drawInternal(\r\n this._renderPassEncoder!,\r\n program,\r\n vertexData,\r\n stateSet,\r\n bindGroups,\r\n bindGroupOffsets,\r\n primitiveType,\r\n first,\r\n count,\r\n numInstances\r\n );\r\n }\r\n clear(color: Nullable<Vector4>, depth: Nullable<number>, stencil: Nullable<number>) {\r\n if (!this._currentScissor) {\r\n this.end();\r\n this.begin(color, depth, stencil);\r\n } else {\r\n if (!this._renderPassEncoder) {\r\n this.begin();\r\n }\r\n this._renderPassEncoder!.insertDebugMarker('clear');\r\n WebGPUClearQuad.drawClearQuad(this, color, depth, stencil);\r\n this._renderPassEncoder!.insertDebugMarker('end clear');\r\n }\r\n }\r\n getDevice() {\r\n return this._device;\r\n }\r\n getFrameBufferInfo() {\r\n return this._frameBufferInfo;\r\n }\r\n begin(color?: Nullable<TypedArray>, depth?: Nullable<number>, stencil?: Nullable<number>) {\r\n if (this.active) {\r\n console.error('WebGPURenderPass.begin() failed: begin() has already been called');\r\n return;\r\n }\r\n this._renderCommandEncoder = this._device.commandQueue.getEncoder();\r\n const frameBuffer = this._frameBufferInfo.frameBuffer;\r\n if (!frameBuffer) {\r\n const mainPassDesc = this._device.defaultRenderPassDesc;\r\n const colorAttachmentDesc = (\r\n this._device.defaultRenderPassDesc.colorAttachments as GPURenderPassColorAttachment[]\r\n )[0];\r\n if (this._frameBufferInfo.sampleCount > 1) {\r\n colorAttachmentDesc.resolveTarget = this._device.context!.getCurrentTexture().createView();\r\n } else {\r\n colorAttachmentDesc.view = this._device.context!.getCurrentTexture().createView();\r\n }\r\n colorAttachmentDesc.loadOp = color ? 'clear' : 'load';\r\n // TODO: GPUColor type in @webgpu/types conficts with lib.dom,use `any` type to make ts-server happy\r\n colorAttachmentDesc.clearValue = (color as any) ?? undefined;\r\n const depthAttachmentDesc = this._device.defaultRenderPassDesc.depthStencilAttachment;\r\n depthAttachmentDesc!.depthLoadOp = typeof depth === 'number' ? 'clear' : 'load';\r\n depthAttachmentDesc!.depthClearValue = depth ?? undefined;\r\n depthAttachmentDesc!.stencilLoadOp = typeof stencil === 'number' ? 'clear' : 'load';\r\n depthAttachmentDesc!.stencilClearValue = stencil ?? undefined;\r\n this._renderPassEncoder = this._renderCommandEncoder.beginRenderPass(mainPassDesc);\r\n } else {\r\n const depthAttachmentTexture = frameBuffer.getDepthAttachment() as WebGPUBaseTexture;\r\n let depthTextureView: GPUTextureView;\r\n if (depthAttachmentTexture) {\r\n depthAttachmentTexture._markAsCurrentFB(true);\r\n const attachment = frameBuffer.getOptions().depthAttachment;\r\n const layer =\r\n depthAttachmentTexture.isTexture2DArray() || depthAttachmentTexture.isTexture3D()\r\n ? attachment!.layer\r\n : depthAttachmentTexture.isTextureCube()\r\n ? attachment!.face\r\n : 0;\r\n depthTextureView = depthAttachmentTexture.getView(0, layer ?? 0, 1);\r\n }\r\n this._fbBindFlag = frameBuffer.bindFlag;\r\n\r\n const passDesc: GPURenderPassDescriptor = {\r\n label: `customRenderPass:${this._frameBufferInfo.hash}`,\r\n colorAttachments:\r\n frameBuffer.getOptions().colorAttachments?.map((attachment, index) => {\r\n const tex = attachment.texture as WebGPUBaseTexture;\r\n if (tex) {\r\n tex._markAsCurrentFB(true);\r\n const layer =\r\n tex.isTexture2DArray() || tex.isTexture3D()\r\n ? attachment.layer\r\n : tex.isTextureCube()\r\n ? attachment.face\r\n : 0;\r\n if (frameBuffer.getOptions().sampleCount === 1) {\r\n return {\r\n view: tex.getView(attachment.level ?? 0, layer ?? 0, 1),\r\n loadOp: color ? 'clear' : 'load',\r\n clearValue: color,\r\n storeOp: 'store'\r\n } as GPURenderPassColorAttachment;\r\n } else {\r\n const msaaTexture = frameBuffer.getMSAAColorAttacments()![index];\r\n const msaaView = this._device.gpuCreateTextureView(msaaTexture, {\r\n dimension: '2d',\r\n baseMipLevel: attachment.level ?? 0,\r\n mipLevelCount: 1,\r\n baseArrayLayer: 0,\r\n arrayLayerCount: 1\r\n });\r\n return {\r\n view: msaaView,\r\n resolveTarget: tex.getView(attachment.level ?? 0, layer ?? 0, 1),\r\n loadOp: color ? 'clear' : 'load',\r\n clearValue: color,\r\n storeOp: 'store'\r\n } as GPURenderPassColorAttachment;\r\n }\r\n } else {\r\n return null;\r\n }\r\n }) ?? [],\r\n depthStencilAttachment: depthAttachmentTexture\r\n ? frameBuffer.getOptions().sampleCount === 1\r\n ? {\r\n view: depthTextureView!,\r\n depthLoadOp: typeof depth === 'number' ? 'clear' : 'load',\r\n depthClearValue: depth ?? undefined,\r\n depthStoreOp: 'store',\r\n stencilLoadOp: hasStencilChannel(depthAttachmentTexture.format)\r\n ? typeof stencil === 'number'\r\n ? 'clear'\r\n : 'load'\r\n : undefined,\r\n stencilClearValue: stencil ?? undefined,\r\n stencilStoreOp: hasStencilChannel(depthAttachmentTexture.format) ? 'store' : undefined\r\n }\r\n : {\r\n view: frameBuffer.getMSAADepthAttachment()!.createView(),\r\n depthLoadOp: typeof depth === 'number' ? 'clear' : 'load',\r\n depthClearValue: depth ?? undefined,\r\n depthStoreOp: 'store',\r\n stencilLoadOp: hasStencilChannel(depthAttachmentTexture.format)\r\n ? typeof stencil === 'number'\r\n ? 'clear'\r\n : 'load'\r\n : undefined,\r\n stencilClearValue: stencil ?? undefined,\r\n stencilStoreOp: hasStencilChannel(depthAttachmentTexture.format) ? 'store' : undefined\r\n }\r\n : undefined\r\n };\r\n this._renderPassEncoder = this._renderCommandEncoder.beginRenderPass(passDesc);\r\n }\r\n this.setViewport(this._currentViewport);\r\n this.setScissor(this._currentScissor);\r\n }\r\n end() {\r\n if (!this.active) {\r\n return;\r\n }\r\n // finish current render pass command\r\n if (this._renderPassEncoder) {\r\n this._renderPassEncoder.end();\r\n this._renderPassEncoder = null;\r\n }\r\n this._renderCommandEncoder = null;\r\n // unmark render target flags and generate render target mipmaps if needed\r\n if (this._frameBufferInfo.frameBuffer) {\r\n const options = this._frameBufferInfo.frameBuffer.getOptions();\r\n if (options.colorAttachments) {\r\n for (const attachment of options.colorAttachments) {\r\n (attachment.texture as WebGPUBaseTexture)._markAsCurrentFB(false);\r\n if (attachment.generateMipmaps && attachment.texture.mipLevelCount > 1) {\r\n attachment.texture.generateMipmaps();\r\n }\r\n }\r\n }\r\n (options.depthAttachment?.texture as WebGPUBaseTexture)?._markAsCurrentFB(false);\r\n }\r\n }\r\n capture(\r\n renderBundleEncoder: GPURenderBundleEncoder,\r\n program: WebGPUProgram,\r\n vertexData: WebGPUVertexLayout,\r\n stateSet: WebGPURenderStateSet,\r\n bindGroups: WebGPUBindGroup[],\r\n bindGroupOffsets: Nullable<Iterable<number>>[],\r\n primitiveType: PrimitiveType,\r\n first: number,\r\n count: number,\r\n numInstances: number\r\n ) {\r\n const validation = this.validateDraw(\r\n program,\r\n bindGroups,\r\n stateSet,\r\n primitiveType,\r\n first,\r\n count,\r\n numInstances\r\n );\r\n if (validation & VALIDATION_FAILED) {\r\n return;\r\n }\r\n this.drawInternal(\r\n this._renderPassEncoder!,\r\n program,\r\n vertexData,\r\n stateSet,\r\n bindGroups,\r\n bindGroupOffsets,\r\n primitiveType,\r\n first,\r\n count,\r\n numInstances,\r\n renderBundleEncoder\r\n );\r\n }\r\n private drawInternal(\r\n renderPassEncoder: GPURenderPassEncoder,\r\n program: WebGPUProgram,\r\n vertexData: Nullable<WebGPUVertexLayout>,\r\n stateSet: WebGPURenderStateSet,\r\n bindGroups: WebGPUBindGroup[],\r\n bindGroupOffsets: Nullable<Nullable<Iterable<number>>[]>,\r\n primitiveType: PrimitiveType,\r\n first: number,\r\n count: number,\r\n numInstances: number,\r\n renderBundleEncoder?: GPURenderBundleEncoder\r\n ) {\r\n if (\r\n this.setBindGroupsForRender(\r\n renderPassEncoder,\r\n program,\r\n bindGroups,\r\n bindGroupOffsets,\r\n renderBundleEncoder\r\n )\r\n ) {\r\n const pipeline = this._device.pipelineCache.fetchRenderPipeline(\r\n program,\r\n vertexData,\r\n stateSet,\r\n primitiveType,\r\n this._frameBufferInfo\r\n );\r\n if (pipeline) {\r\n renderPassEncoder.setPipeline(pipeline);\r\n renderBundleEncoder?.setPipeline(pipeline);\r\n const stencilState = stateSet?.stencilState;\r\n if (stencilState) {\r\n renderPassEncoder.setStencilReference(stencilState.ref);\r\n }\r\n if (vertexData) {\r\n const vertexBuffers = vertexData.getLayouts(program.vertexAttributes)?.buffers;\r\n vertexBuffers?.forEach((val, index) => {\r\n renderPassEncoder.setVertexBuffer(index, val.buffer.object as GPUBuffer, val.drawOffset);\r\n renderBundleEncoder?.setVertexBuffer(index, val.buffer.object as GPUBuffer, val.drawOffset);\r\n });\r\n const indexBuffer = vertexData.getIndexBuffer() as unknown as WebGPUIndexBuffer;\r\n if (indexBuffer) {\r\n renderPassEncoder.setIndexBuffer(\r\n indexBuffer.object!,\r\n indexBuffer.indexType === typeU16 ? 'uint16' : 'uint32'\r\n );\r\n renderBundleEncoder?.setIndexBuffer(\r\n indexBuffer.object!,\r\n indexBuffer.indexType === typeU16 ? 'uint16' : 'uint32'\r\n );\r\n renderPassEncoder.drawIndexed(count, numInstances, first);\r\n renderBundleEncoder?.drawIndexed(count, numInstances, first);\r\n } else {\r\n renderPassEncoder.draw(count, numInstances, first);\r\n renderBundleEncoder?.draw(count, numInstances, first);\r\n }\r\n } else {\r\n renderPassEncoder.draw(count, numInstances, first);\r\n renderBundleEncoder?.draw(count, numInstances, first);\r\n }\r\n }\r\n }\r\n }\r\n private validateDraw(\r\n program: WebGPUProgram,\r\n bindGroups: WebGPUBindGroup[],\r\n stateSet: WebGPURenderStateSet,\r\n primitiveType: PrimitiveType,\r\n first: number,\r\n count: number,\r\n numInstances: number\r\n ) {\r\n let validation = 0;\r\n const colorTargetCount = this._frameBufferInfo.colorFormats.length;\r\n if (colorTargetCount !== 0 && program.fragmentOutputCount !== colorTargetCount) {\r\n if (\r\n !stateSet?.colorState ||\r\n stateSet.colorState.redMask ||\r\n stateSet.colorState.greenMask ||\r\n stateSet.colorState.blueMask ||\r\n stateSet.colorState.alphaMask\r\n ) {\r\n const framebuffer = this._frameBufferInfo.frameBuffer;\r\n const colorAttachments = framebuffer?.getColorAttachments().map((texture, index) => ({\r\n index,\r\n name: texture?.name,\r\n uid: texture?.uid,\r\n format: texture?.format\r\n })) ?? [{ index: 0, name: '<backbuffer>', uid: 0, format: this._frameBufferInfo.colorFormats[0] }];\r\n console.error('WebGPU draw validation failed: fragment color output count mismatch', {\r\n programName: program.name,\r\n programLabel: program.label,\r\n programHash: program.hash,\r\n fragmentOutputCount: program.fragmentOutputCount,\r\n colorTargetCount,\r\n colorFormats: this._frameBufferInfo.colorFormats,\r\n depthFormat: this._frameBufferInfo.depthFormat,\r\n framebufferName: framebuffer?.name ?? '<backbuffer>',\r\n framebufferHash: this._frameBufferInfo.hash,\r\n colorAttachments,\r\n primitiveType,\r\n first,\r\n count,\r\n numInstances,\r\n stack: new Error().stack\r\n });\r\n validation |= VALIDATION_FAILED;\r\n }\r\n }\r\n if (bindGroups) {\r\n for (let i = 0; i < program.bindGroupLayouts.length; i++) {\r\n const bindGroup = bindGroups[i];\r\n if (bindGroup) {\r\n if (bindGroup.bindGroup) {\r\n for (const ubo of bindGroup.bufferList) {\r\n if (ubo.disposed) {\r\n validation |= VALIDATION_FAILED;\r\n }\r\n }\r\n for (const tex of bindGroup.textureList) {\r\n if (tex.disposed) {\r\n validation |= VALIDATION_FAILED;\r\n }\r\n if (tex._isMarkedAsCurrentFB()) {\r\n console.error('bind resource texture can not be current render target');\r\n validation |= VALIDATION_FAILED;\r\n }\r\n }\r\n }\r\n } else {\r\n console.error(`Missing bind group (${i}) when drawing with program '${program.name}'`);\r\n return VALIDATION_FAILED;\r\n }\r\n }\r\n }\r\n if (\r\n this._frameBufferInfo.frameBuffer &&\r\n this._frameBufferInfo.frameBuffer.bindFlag !== this._fbBindFlag\r\n ) {\r\n validation |= VALIDATION_NEED_NEW_PASS;\r\n }\r\n return validation;\r\n }\r\n private setBindGroupsForRender(\r\n renderPassEncoder: GPURenderPassEncoder,\r\n program: WebGPUProgram,\r\n bindGroups: WebGPUBindGroup[],\r\n bindGroupOffsets: Nullable<Nullable<Iterable<number>>[]>,\r\n renderBundleEncoder?: GPURenderBundleEncoder\r\n ) {\r\n if (bindGroups) {\r\n for (let i = 0; i < 4; i++) {\r\n if (i < program.bindGroupLayouts.length) {\r\n const bindGroup = bindGroups[i].bindGroup;\r\n if (!bindGroup) {\r\n return false;\r\n }\r\n const bindGroupOffset = bindGroups[i].getDynamicOffsets() ?? bindGroupOffsets?.[i];\r\n if (bindGroupOffset) {\r\n renderPassEncoder.setBindGroup(i, bindGroup, bindGroupOffset);\r\n renderBundleEncoder?.setBindGroup(i, bindGroup, bindGroupOffset);\r\n } else {\r\n renderPassEncoder.setBindGroup(i, bindGroup);\r\n renderBundleEncoder?.setBindGroup(i, bindGroup);\r\n }\r\n } else {\r\n renderPassEncoder.setBindGroup(i, this._device.emptyBindGroup);\r\n renderBundleEncoder?.setBindGroup(i, this._device.emptyBindGroup);\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n}\r\n"],"names":["VALIDATION_NEED_NEW_PASS","VALIDATION_FAILED","typeU16","PBPrimitiveTypeInfo","getCachedTypeInfo","PBPrimitiveType","U16","WebGPURenderPass","_device","_renderCommandEncoder","_renderPassEncoder","_fbBindFlag","_currentViewport","_currentScissor","_frameBufferInfo","device","createFrameBufferInfo","active","fb","info","frameBuffer","colorFormats","backbufferFormat","depthFormat","backbufferDepthFormat","sampleCount","hash","clearHash","getColorAttachments","map","val","gpuFormat","getDepthAttachment","getOptions","fmt","textureFormatInvMap","isIntegerTextureFormat","isSignedTextureFormat","join","setFramebuffer","end","setViewport","setScissor","getFramebuffer","vp","Array","isArray","default","x","y","width","deviceXToScreen","drawingBufferWidth","height","deviceYToScreen","drawingBufferHeight","Object","assign","vx","screenXToDevice","vy","screenYToDevice","vw","vh","getViewport","scissor","backBufferWidth","backBufferHeight","undefined","Math","min","setScissorRect","getScissor","executeRenderBundle","renderBundle","begin","executeBundles","draw","program","vertexData","stateSet","bindGroups","bindGroupOffsets","primitiveType","first","count","numInstances","validation","validateDraw","drawInternal","clear","color","depth","stencil","insertDebugMarker","WebGPUClearQuad","drawClearQuad","getDevice","getFrameBufferInfo","console","error","commandQueue","getEncoder","mainPassDesc","defaultRenderPassDesc","colorAttachmentDesc","colorAttachments","resolveTarget","context","getCurrentTexture","createView","view","loadOp","clearValue","depthAttachmentDesc","depthStencilAttachment","depthLoadOp","depthClearValue","stencilLoadOp","stencilClearValue","beginRenderPass","depthAttachmentTexture","depthTextureView","_markAsCurrentFB","attachment","depthAttachment","layer","isTexture2DArray","isTexture3D","isTextureCube","face","getView","bindFlag","passDesc","label","index","tex","texture","level","storeOp","msaaTexture","getMSAAColorAttacments","msaaView","gpuCreateTextureView","dimension","baseMipLevel","mipLevelCount","baseArrayLayer","arrayLayerCount","depthStoreOp","hasStencilChannel","format","stencilStoreOp","getMSAADepthAttachment","options","generateMipmaps","capture","renderBundleEncoder","renderPassEncoder","setBindGroupsForRender","pipeline","pipelineCache","fetchRenderPipeline","setPipeline","stencilState","setStencilReference","ref","vertexBuffers","getLayouts","vertexAttributes","buffers","forEach","setVertexBuffer","buffer","object","drawOffset","indexBuffer","getIndexBuffer","setIndexBuffer","indexType","drawIndexed","colorTargetCount","length","fragmentOutputCount","colorState","redMask","greenMask","blueMask","alphaMask","framebuffer","name","uid","programName","programLabel","programHash","framebufferName","framebufferHash","stack","Error","i","bindGroupLayouts","bindGroup","ubo","bufferList","disposed","textureList","_isMarkedAsCurrentFB","bindGroupOffset","getDynamicOffsets","setBindGroup","emptyBindGroup"],"mappings":";;;;AAqBA,MAAMA,2BAA2B,CAAK,IAAA,CAAA;AACtC,MAAMC,oBAAoB,CAAK,IAAA,CAAA;AAE/B,MAAMC,OAAUC,GAAAA,mBAAAA,CAAoBC,iBAAiB,CAACC,gBAAgBC,GAAG,CAAA;AAElE,MAAMC,gBAAAA,CAAAA;IACMC,OAAsB;IAC/BC,qBAAmD;IACnDC,kBAAmD;IACnDC,WAA8B;IAC9BC,gBAA2C;IAC3CC,eAA0C;IAC1CC,gBAAkC;AAC1C,IAAA,WAAA,CAAYC,MAAoB,CAAE;QAChC,IAAI,CAACP,OAAO,GAAGO,MAAAA;QACf,IAAI,CAACN,qBAAqB,GAAG,IAAA;QAC7B,IAAI,CAACC,kBAAkB,GAAG,IAAA;QAC1B,IAAI,CAACC,WAAW,GAAG,IAAA;QACnB,IAAI,CAACC,gBAAgB,GAAG,IAAA;QACxB,IAAI,CAACC,eAAe,GAAG,IAAA;AACvB,QAAA,IAAI,CAACC,gBAAgB,GAAG,IAAI,CAACE,qBAAqB,CAAC,IAAA,CAAA;AACrD;AACA,IAAA,IAAIC,MAAS,GAAA;AACX,QAAA,OAAO,CAAC,CAAC,IAAI,CAACP,kBAAkB;AAClC;AACQM,IAAAA,qBAAAA,CAAsBE,EAA+B,EAAE;QAC7D,MAAMC,IAAAA,GAAwB,C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