@woosh/meep-engine 3.60.9 → 3.61.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/package.json +1 -1
  3. package/src/engine/ecs/EntityManager.d.ts +3 -3
  4. package/src/engine/ecs/EntityManager.js +3 -3
  5. package/src/engine/ecs/storage/populateEngineSerializationRegistry.d.ts.map +1 -1
  6. package/src/engine/ecs/storage/populateEngineSerializationRegistry.js +4 -0
  7. package/src/engine/graphics/ecs/decal/v2/Decal.d.ts +46 -2
  8. package/src/engine/graphics/ecs/decal/v2/Decal.d.ts.map +1 -1
  9. package/src/engine/graphics/ecs/decal/v2/Decal.js +74 -5
  10. package/src/engine/graphics/ecs/decal/v2/DecalSerializationAdapter.d.ts.map +1 -1
  11. package/src/engine/graphics/ecs/decal/v2/DecalSerializationAdapter.js +13 -1
  12. package/src/engine/graphics/ecs/decal/v2/DecalSerializationUpgrader_1_2.d.ts +9 -0
  13. package/src/engine/graphics/ecs/decal/v2/DecalSerializationUpgrader_1_2.d.ts.map +1 -0
  14. package/src/engine/graphics/ecs/decal/v2/DecalSerializationUpgrader_1_2.js +37 -0
  15. package/src/engine/graphics3/DecalSystem.d.ts.map +1 -1
  16. package/src/engine/graphics3/DecalSystem.js +462 -447
  17. package/src/engine/graphics3/decal/DECAL_GPU_RECORD.d.ts +14 -0
  18. package/src/engine/graphics3/decal/DECAL_GPU_RECORD.d.ts.map +1 -1
  19. package/src/engine/graphics3/decal/DECAL_GPU_RECORD.js +53 -13
  20. package/src/engine/graphics3/decal/chunk_decal_record.d.ts +6 -1
  21. package/src/engine/graphics3/decal/chunk_decal_record.d.ts.map +1 -1
  22. package/src/engine/graphics3/decal/chunk_decal_record.js +28 -9
  23. package/src/engine/graphics3/decal/decal_gpu_records.d.ts +2 -1
  24. package/src/engine/graphics3/decal/decal_gpu_records.d.ts.map +1 -1
  25. package/src/engine/graphics3/decal/decal_gpu_records.js +26 -5
  26. package/src/engine/graphics3/decal/decal_material_samplers.d.ts +6 -0
  27. package/src/engine/graphics3/decal/decal_material_samplers.d.ts.map +1 -1
  28. package/src/engine/graphics3/decal/decal_material_samplers.js +13 -0
  29. package/src/engine/graphics3/decal/shader_cluster_assign_decals.js +1 -1
  30. package/src/engine/graphics3/decal/shader_cull_decals_frustum.js +1 -1
  31. package/src/engine/graphics3/decal/shader_decal_composite.d.ts +5 -0
  32. package/src/engine/graphics3/decal/shader_decal_composite.d.ts.map +1 -1
  33. package/src/engine/graphics3/decal/shader_decal_composite.js +69 -28
  34. package/src/engine/network/NetworkSession.d.ts +3 -0
  35. package/src/engine/network/NetworkSession.d.ts.map +1 -1
  36. package/src/engine/network/NetworkSession.js +68 -10
  37. package/src/engine/network/README.md +6 -3
  38. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts +51 -5
  39. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts.map +1 -1
  40. package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +308 -34
  41. package/src/engine/network/replication/Replicator.d.ts +8 -2
  42. package/src/engine/network/replication/Replicator.d.ts.map +1 -1
  43. package/src/engine/network/replication/Replicator.js +13 -4
  44. package/src/engine/network/sim/ActionLog.d.ts +16 -2
  45. package/src/engine/network/sim/ActionLog.d.ts.map +1 -1
  46. package/src/engine/network/sim/ActionLog.js +33 -2
  47. package/src/engine/network/sim/RewindEngine.d.ts +9 -0
  48. package/src/engine/network/sim/RewindEngine.d.ts.map +1 -1
  49. package/src/engine/network/sim/RewindEngine.js +15 -1
  50. package/src/engine/network/state/FrameBufferRing.d.ts +12 -5
  51. package/src/engine/network/state/FrameBufferRing.d.ts.map +1 -1
  52. package/src/engine/network/state/FrameBufferRing.js +32 -6
  53. package/src/engine/network/time/TimeDilation.d.ts +30 -14
  54. package/src/engine/network/time/TimeDilation.d.ts.map +1 -1
  55. package/src/engine/network/time/TimeDilation.js +47 -17
  56. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  57. package/src/generation/foliage/skeleton/ShootWoodHash.d.ts +3 -2
  58. package/src/generation/foliage/skeleton/ShootWoodHash.d.ts.map +1 -1
  59. package/src/generation/foliage/skeleton/ShootWoodHash.js +25 -2
  60. package/src/shade/renderer/buffer/graph_read_buffer.d.ts +3 -1
  61. package/src/shade/renderer/buffer/graph_read_buffer.d.ts.map +1 -1
  62. package/src/shade/renderer/buffer/graph_read_buffer.js +9 -6
  63. package/src/shade/renderer/buffer/util/shader_buffer_copy_storage_to_storage.d.ts +5 -0
  64. package/src/shade/renderer/buffer/util/shader_buffer_copy_storage_to_storage.d.ts.map +1 -1
  65. package/src/shade/renderer/buffer/util/shader_buffer_copy_storage_to_storage.js +48 -43
  66. package/src/shade/renderer/material/GPUMaterialManager.d.ts.map +1 -1
  67. package/src/shade/renderer/material/GPUMaterialManager.js +117 -35
  68. package/src/shade/renderer/material/standard/fragment_gbuffer.d.ts +2 -2
  69. package/src/shade/renderer/material/standard/fragment_gbuffer.d.ts.map +1 -1
  70. package/src/shade/renderer/material/standard/fragment_gbuffer.js +10 -3
  71. package/src/shade/renderer/material/standard/material_gbuffer_vertex.d.ts +15 -3
  72. package/src/shade/renderer/material/standard/material_gbuffer_vertex.d.ts.map +1 -1
  73. package/src/shade/renderer/material/standard/material_gbuffer_vertex.js +25 -4
  74. package/src/shade/renderer/particles/GPUParticleSystem.d.ts +23 -5
  75. package/src/shade/renderer/particles/GPUParticleSystem.d.ts.map +1 -1
  76. package/src/shade/renderer/particles/GPUParticleSystem.js +294 -20
  77. package/src/shade/renderer/particles/resize/shader_particle_shrink_alive_list.d.ts +21 -0
  78. package/src/shade/renderer/particles/resize/shader_particle_shrink_alive_list.d.ts.map +1 -0
  79. package/src/shade/renderer/particles/resize/shader_particle_shrink_alive_list.js +83 -0
  80. package/src/shade/renderer/particles/resize/shader_particle_shrink_free_list.d.ts +21 -0
  81. package/src/shade/renderer/particles/resize/shader_particle_shrink_free_list.d.ts.map +1 -0
  82. package/src/shade/renderer/particles/resize/shader_particle_shrink_free_list.js +64 -0
  83. package/src/shade/renderer/restir/di/chunk_restir_resolve.d.ts.map +1 -1
  84. package/src/shade/renderer/restir/di/chunk_restir_resolve.js +91 -94
  85. package/src/shade/renderer/restir/reservoir/chunk_rtxdi_stream_sample.js +1 -1
  86. package/src/shade/renderer/shader/chunk/color/rgbe9995/chunk_rgbe9995_decode.d.ts +14 -0
  87. package/src/shade/renderer/shader/chunk/color/rgbe9995/chunk_rgbe9995_decode.d.ts.map +1 -1
  88. package/src/shade/renderer/shader/chunk/color/rgbe9995/chunk_rgbe9995_decode.js +36 -21
  89. package/src/shade/renderer/shader/chunk/color/rgbe9995/chunk_rgbe9995_sample_gather.d.ts +22 -0
  90. package/src/shade/renderer/shader/chunk/color/rgbe9995/chunk_rgbe9995_sample_gather.d.ts.map +1 -0
  91. package/src/shade/renderer/shader/chunk/color/rgbe9995/chunk_rgbe9995_sample_gather.js +64 -0
  92. package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_vertex_normal.d.ts.map +1 -1
  93. package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_vertex_normal.js +13 -18
  94. package/src/shade/renderer/shader/chunk/geometry/normal/chunk_encode_vertex_normal.d.ts.map +1 -1
  95. package/src/shade/renderer/shader/chunk/geometry/normal/chunk_encode_vertex_normal.js +28 -30
  96. package/src/shade/renderer/shader/chunk/geometry/vec2/chunk_unit_u32_to_vec2.d.ts.map +1 -1
  97. package/src/shade/renderer/shader/chunk/geometry/vec2/chunk_unit_u32_to_vec2.js +15 -16
  98. package/src/shade/renderer/shader/chunk/geometry/vec2/chunk_unit_vec2_to_u32.d.ts +0 -1
  99. package/src/shade/renderer/shader/chunk/geometry/vec2/chunk_unit_vec2_to_u32.d.ts.map +1 -1
  100. package/src/shade/renderer/shader/chunk/geometry/vec2/chunk_unit_vec2_to_u32.js +15 -18
  101. package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_bitset_or.d.ts +32 -0
  102. package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_bitset_or.d.ts.map +1 -0
  103. package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_bitset_or.js +73 -0
  104. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +8 -1
  105. package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
  106. package/src/shade/wgsl/emulator/WGSLLanguageCore.js +7 -3
  107. package/src/shade/renderer/global_illumination/brick4/cpu/brick4_sh3_color_encode.d.ts +0 -2
  108. package/src/shade/renderer/global_illumination/brick4/cpu/brick4_sh3_color_encode.d.ts.map +0 -1
  109. package/src/shade/renderer/global_illumination/brick4/cpu/brick4_sh3_color_encode.js +0 -6
@@ -1,44 +1,49 @@
1
- import { u32 } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
2
- import { WebGPUArray } from "../../shader/type/WebGPUArray.js";
3
- import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
4
- import { COMPUTE_SHADER_DEFAULT_GROUP_SIZE } from "../../shader/COMPUTE_SHADER_DEFAULT_GROUP_SIZE.js";
5
- import { ComputeShader } from "../../shader/ComputeShader.js";
6
- import { ShaderResourceSetDescriptor } from "../../shader/resource/ShaderResourceSetDescriptor.js";
7
-
8
- const resources = new ShaderResourceSetDescriptor();
9
-
10
- // per-dispatch, four bytes, read-only: immediate data rather than a uniform buffer holding one u32
11
- resources.setImmediate("size", u32);
12
-
13
- resources.createGroup()
14
- .addStorageBuffer("source", WebGPUArray.u32)
15
- .addStorageBuffer("destination", WebGPUArray.u32, true)
16
-
17
- const body = CodeChunk.from(
18
- //language=WGSL
19
- `
20
- @compute @workgroup_size(${COMPUTE_SHADER_DEFAULT_GROUP_SIZE})
21
- fn main(
22
- @builtin(global_invocation_id) global_id : vec3<u32>
23
- ){
24
- let index = global_id.x;
25
-
26
- if(index >= size){
27
- return;
28
- }
29
-
30
- destination[index] = source[index];
31
- }
32
- `
33
- )
34
-
35
- /**
36
- * Shader is useful for copying buffers where the buffers are missing `GPUBufferUsage.COPY_DST` or `GPUBufferUsage.COPY_SRC`.
37
- * This is a pure utility shader.
38
- * @type {ComputeShader}
39
- */
40
- export const shader_buffer_copy_storage_to_storage = ComputeShader.from({
41
- label: "Copy GPU Buffer/ STORAGE -> STORAGE",
42
- body,
43
- resources,
1
+ import { u32 } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
2
+ import { WebGPUArray } from "../../shader/type/WebGPUArray.js";
3
+ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
4
+ import { COMPUTE_SHADER_DEFAULT_GROUP_SIZE } from "../../shader/COMPUTE_SHADER_DEFAULT_GROUP_SIZE.js";
5
+ import { ComputeShader } from "../../shader/ComputeShader.js";
6
+ import { ShaderResourceSetDescriptor } from "../../shader/resource/ShaderResourceSetDescriptor.js";
7
+
8
+ const resources = new ShaderResourceSetDescriptor();
9
+
10
+ // per-dispatch, four bytes, read-only: immediate data rather than a uniform buffer holding one u32
11
+ resources.setImmediate("size", u32);
12
+
13
+ resources.createGroup()
14
+ .addStorageBuffer("source", WebGPUArray.u32)
15
+ .addStorageBuffer("destination", WebGPUArray.u32, true)
16
+
17
+ const body = CodeChunk.from(
18
+ //language=WGSL
19
+ `
20
+ @compute @workgroup_size(${COMPUTE_SHADER_DEFAULT_GROUP_SIZE})
21
+ fn main(
22
+ @builtin(global_invocation_id) global_id : vec3<u32>,
23
+ @builtin(num_workgroups) group_count : vec3<u32>,
24
+ ){
25
+ // The grid may be smaller than the copy; every lane keeps taking the next word a whole grid on.
26
+ let stride = group_count.x * ${COMPUTE_SHADER_DEFAULT_GROUP_SIZE}u;
27
+
28
+ for (var index = global_id.x; index < size; index += stride) {
29
+ destination[index] = source[index];
30
+ }
31
+ }
32
+ `
33
+ )
34
+
35
+ /**
36
+ * Shader is useful for copying buffers where the buffers are missing `GPUBufferUsage.COPY_DST` or `GPUBufferUsage.COPY_SRC`.
37
+ * This is a pure utility shader.
38
+ *
39
+ * Copies the first `size` words. The launch may be smaller than that — a copy longer than
40
+ * `maxComputeWorkgroupsPerDimension` workgroups has to be — and every lane strides through the rest
41
+ * by the whole grid, so a caller that clamps the launch still has every word copied.
42
+ *
43
+ * @type {ComputeShader}
44
+ */
45
+ export const shader_buffer_copy_storage_to_storage = ComputeShader.from({
46
+ label: "Copy GPU Buffer/ STORAGE -> STORAGE",
47
+ body,
48
+ resources,
44
49
  });
@@ -1 +1 @@
1
- {"version":3,"file":"GPUMaterialManager.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/material/GPUMaterialManager.js"],"names":[],"mappings":"AA4NA;IA4FI;;;;;;;;OAQG;IACH,yCANW,cAAc,oBACd,qBAAqB,YACrB,gBAAgB,qBAChB,qBAAqB,aACrB,iBAAiB,EAiD3B;IAlJD;;;;;OAKG;IACH,wBAAkC;IAOlC;;;OAGG;IACH,UAFU,IAAI,aAAa,EAAE,kBAAkB,CAAC,CAE3B;IAyBrB;;;OAGG;IACH,yCAEC;IAID;;;OAGG;IACH,sBAEC;IAsLD;;;;;;;;;;OAUG;IACH;QAR+B,KAAK,EAAzB,UAAU;QACc,IAAI,EAA5B,cAAc;QACE,gBAAgB,EAAhC,MAAM;QACU,oBAAoB,EAApC,MAAM;QACU,cAAc,EAA9B,MAAM;QAEJ;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAC,CA4LnF;IAED;;;;OAIG;IACH,iBAHW,aAAa,GACX,kBAAkB,CAqB9B;IAED;;;;;;;;;;;;OAYG;IACH,kBAHW,aAAa,GACX,OAAO,CAyBnB;IAED;;;;OAIG;IACH,gBAaC;IAED;;;;;;;OAOG;IACH,0BAFW,eAAe,QAazB;IAED;;;;;;;;;;;OAWG;IACH,kBAHW,qBAAqB,GACnB,QAAQ,IAAI,CAAC,CAMzB;IAsBD;;;;;;OAMG;IACH,0BAHW,aAAa,EAAE,GACb,aAAa,EAAE,CAI3B;IAED;;;;;;OAMG;IACH,wBAHW,aAAa,EAAE,GACb,aAAa,EAAE,CAI3B;IAED;;;;;;;OAOG;IACH,wBAHW,aAAa,EAAE,GACb,kBAAkB,EAAE,CAIhC;IAED;;;;OAIG;IACH,uCAEC;IAED;;;;OAIG;IACH,oCAEC;IAuED;;;OAGG;IACH,YAFW,sBAAsB,QAmChC;;CAEJ;8BAh6BY,OAAO,0CAA0C,EAAE,eAAe;6BAClE,OAAO,2BAA2B,EAAE,cAAc;yBAIlD,OAAO,2DAA2D,EAAE,UAAU;qCAC9E,OAAO,wCAAwC,EAAE,sBAAsB;oCACvE,OAAO,gDAAgD,EAAE,qBAAqB;+BAC9E,OAAO,gCAAgC,EAAE,gBAAgB;gCACzD,OAAO,yBAAyB,EAAE,iBAAiB;6BACnD,OAAO,8BAA8B,EAAE,cAAc;oCACrD,OAAO,6CAA6C,EAAE,qBAAqB;4BAC3E,OAAO,oBAAoB,EAAE,aAAa;oCAC1C,OAAO,qCAAqC,EAAE,qBAAqB;mCAtBzE,yBAAyB;mCAjBG,8CAA8C;oCAoBxB,mCAAmC"}
1
+ {"version":3,"file":"GPUMaterialManager.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/material/GPUMaterialManager.js"],"names":[],"mappings":"AA8QA;IA4FI;;;;;;;;OAQG;IACH,yCANW,cAAc,oBACd,qBAAqB,YACrB,gBAAgB,qBAChB,qBAAqB,aACrB,iBAAiB,EAiD3B;IAlJD;;;;;OAKG;IACH,wBAAkC;IAOlC;;;OAGG;IACH,UAFU,IAAI,aAAa,EAAE,kBAAkB,CAAC,CAE3B;IAyBrB;;;OAGG;IACH,yCAEC;IAID;;;OAGG;IACH,sBAEC;IA0LD;;;;;;;;;;OAUG;IACH;QAR+B,KAAK,EAAzB,UAAU;QACc,IAAI,EAA5B,cAAc;QACE,gBAAgB,EAAhC,MAAM;QACU,oBAAoB,EAApC,MAA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3
  import { BindGroupLayoutDescriptor } from "../../descriptor/binding/BindGroupLayoutDescriptor.js";
4
4
  import { BufferBindingLayout } from "../../descriptor/binding/BufferBindingLayout.js";
5
5
  import { GPUShaderStage } from "../../descriptor/GPUShaderStage.js";
6
+ import { wgsl_enable_extension } from "../../descriptor/WebGPUExtensionType.js";
6
7
  import { RenderPipelineDescriptor } from "../../descriptor/pipeline/render/RenderPipelineDescriptor.js";
7
8
  import { SamplerDescriptor } from "../../descriptor/texture/SamplerDescriptor.js";
8
9
  import { TextureDescriptor } from "../../descriptor/texture/TextureDescriptor.js";
10
+ import { BufferResourceDescriptor } from "../../device/graph/BufferResourceDescriptor.js";
9
11
  import { TextureResourceDescriptor } from "../../device/graph/TextureResourceDescriptor.js";
10
12
  import { BindGroupDescriptor } from "../binding/BindGroupDescriptor.js";
11
13
  import { GPUSingleTypeTable } from "../buffer/table/single/GPUSingleTypeTable.js";
@@ -15,6 +17,10 @@ import {
15
17
  VIZ_BUFFER_INVALID_MESH_VALUE
16
18
  } from "../rasterize/native/viz/VIZ_BUFFER_INVALID_MESH_VALUE.js";
17
19
  import { chunk_scene_database_access } from "../scene/chunk_scene_database_access.js";
20
+ import {
21
+ chunk_subgroup_bitset_or,
22
+ SUBGROUP_BITSET_OR_NONE
23
+ } from "../shader/chunk/subgroup/chunk_subgroup_bitset_or.js";
18
24
  import { CodeChunk } from "../shader/compiler/CodeChunk.js";
19
25
  import { DEFAULT_RENDER_TARGET_VIEW_DESCRIPTOR } from "../texture/DEFAULT_RENDER_TARGET_VIEW_DESCRIPTOR.js";
20
26
  import { BLACK_PIXEL_TEXTURE } from "../texture/util/BLACK_PIXEL_TEXTURE.js";
@@ -86,6 +92,13 @@ class DrawnMaterialLists {
86
92
  * @type {number}
87
93
  */
88
94
  gbuffer_version = -1;
95
+
96
+ /**
97
+ * One past the highest material id in {@link gbuffer}, 0 when it is empty.
98
+ *
99
+ * @type {number}
100
+ */
101
+ gbuffer_id_bound = 0;
89
102
  }
90
103
 
91
104
  /**
@@ -149,10 +162,80 @@ const MATERIAL_BUFFER_BIND_GROUP_1_LAYOUT_DESCRIPTOR = BindGroupLayoutDescriptor
149
162
  binding: 0,
150
163
  visibility: GPUShaderStage.FRAGMENT,
151
164
  buffer: BufferBindingLayout.readOnlyStorage
165
+ },
166
+ {
167
+ binding: 1,
168
+ visibility: GPUShaderStage.FRAGMENT,
169
+ buffer: BufferBindingLayout.storage
152
170
  }
153
171
  ]
154
172
  });
155
173
 
174
+ /**
175
+ * The material-depth pass's fragment stage: writes the material id of each pixel as its depth, for
176
+ * the G-buffer pass to test against, and marks in `material_seen` every material that holds a pixel.
177
+ *
178
+ * @type {CodeChunk}
179
+ */
180
+ const material_depth_fragment = CodeChunk.from(
181
+ // language=WGSL
182
+ `
183
+ @group(0) @binding(0) var mesh_texture: texture_2d<u32>;
184
+ @group(1) @binding(0) var<storage, read> scene_database: array<u32>;
185
+ @group(1) @binding(1) var<storage, read_write> material_seen: array<atomic<u32>>;
186
+
187
+ struct Outputs{
188
+ @builtin(frag_depth) depth:f32,
189
+ }
190
+
191
+ @fragment
192
+ fn main(
193
+ @builtin(position) coord : vec4<f32>
194
+ ) -> Outputs {
195
+
196
+ let pixel = vec2<u32>(coord.xy);
197
+
198
+ var material = ${SUBGROUP_BITSET_OR_NONE}u;
199
+
200
+ // a helper invocation past the edge of the target holds no material, so it marks nothing
201
+ if(all(pixel < textureDimensions(mesh_texture))){
202
+ let mesh_id = textureLoad(
203
+ mesh_texture,
204
+ pixel,
205
+ 0
206
+ ).r;
207
+
208
+ if(mesh_id != ${VIZ_BUFFER_INVALID_MESH_VALUE}){
209
+ material = scene_read_mesh(&scene_database, mesh_id).material;
210
+ }
211
+ }
212
+
213
+ // the G-buffer pass draws only the materials marked here
214
+ subgroup_bitset_or(&material_seen, material);
215
+
216
+ if(material == ${SUBGROUP_BITSET_OR_NONE}u){
217
+ return Outputs(1.0);
218
+ }
219
+
220
+ return Outputs(
221
+ f32(material)/16777216
222
+ );
223
+ }
224
+ `,
225
+ [chunk_scene_database_access, chunk_subgroup_bitset_or]
226
+ );
227
+
228
+ /**
229
+ * @param {{text: string, extensions: string[]}} compiled
230
+ * @returns {string} `compiled.text` after the `enable` directives its extensions need
231
+ */
232
+ function wgsl_with_enables(compiled) {
233
+ return [
234
+ ...compiled.extensions.map(extension => `enable ${wgsl_enable_extension(extension)};`),
235
+ compiled.text
236
+ ].join("\n");
237
+ }
238
+
156
239
  const material_buffer_pipeline_descriptor = RenderPipelineDescriptor.from({
157
240
  layout: {
158
241
  bindGroupLayouts: [
@@ -168,40 +251,7 @@ const material_buffer_pipeline_descriptor = RenderPipelineDescriptor.from({
168
251
  fragment: {
169
252
  module: {
170
253
  label: 'MeshDepth writer',
171
- // language=WGSL
172
- code: CodeChunk.from(
173
- `
174
- @group(0) @binding(0) var mesh_texture: texture_2d<u32>;
175
- @group(1) @binding(0) var<storage, read> scene_database: array<u32>;
176
-
177
- struct Outputs{
178
- @builtin(frag_depth) depth:f32,
179
- }
180
-
181
- @fragment
182
- fn main(
183
- @builtin(position) coord : vec4<f32>
184
- ) -> Outputs {
185
-
186
- let mesh_id = textureLoad(
187
- mesh_texture,
188
- vec2<i32>(coord.xy),
189
- 0
190
- ).r;
191
-
192
- if(mesh_id == ${VIZ_BUFFER_INVALID_MESH_VALUE}){
193
- return Outputs(1.0);
194
- }
195
-
196
- let mesh = scene_read_mesh(&scene_database, mesh_id);
197
-
198
- return Outputs(
199
- f32(mesh.material)/16777216
200
- );
201
- }
202
- `,
203
- [chunk_scene_database_access]
204
- ).compile().text
254
+ code: wgsl_with_enables(material_depth_fragment.compile())
205
255
  },
206
256
  },
207
257
  depthStencil: {
@@ -406,12 +456,15 @@ export class GPUMaterialManager {
406
456
  * @param {GPUViewContext} view
407
457
  * @param {GPUTextureContext} mesh_texture
408
458
  * @param {GPUTextureContext} material_depth_texture
459
+ * @param {GPUBufferBinding} material_seen zeroed, a bit per material id, set for each material
460
+ * that holds a pixel
409
461
  */
410
462
  #prepare_material_depth_buffer(
411
463
  encoder,
412
464
  view,
413
465
  mesh_texture,
414
466
  material_depth_texture,
467
+ material_seen,
415
468
  ) {
416
469
 
417
470
  const pass = encoder.beginRenderPass({
@@ -449,6 +502,7 @@ export class GPUMaterialManager {
449
502
  MATERIAL_BUFFER_BIND_GROUP_1_LAYOUT_DESCRIPTOR,
450
503
  [
451
504
  { buffer: view.scene.scene_database_buffer },
505
+ material_seen,
452
506
  ]
453
507
  ));
454
508
 
@@ -501,6 +555,13 @@ export class GPUMaterialManager {
501
555
 
502
556
  const material_depth = resources.get(data.material_depth);
503
557
 
558
+ // the pool may hand over a larger buffer than asked for; past the size asked for, it is
559
+ // not cleared
560
+ const material_seen = {
561
+ buffer: resources.get(data.material_seen),
562
+ size: data.material_seen_size,
563
+ };
564
+
504
565
  const encoder = context.encoder;
505
566
 
506
567
  encoder.pushDebugGroup("Material Draw")
@@ -513,6 +574,7 @@ export class GPUMaterialManager {
513
574
  view,
514
575
  viz_mesh,
515
576
  material_depth,
577
+ material_seen,
516
578
  );
517
579
 
518
580
  const pass = encoder.beginRenderPass({
@@ -559,6 +621,7 @@ export class GPUMaterialManager {
559
621
  viz_mesh.obtainView(),
560
622
  { buffer: view.uniform_buffer.buffer },
561
623
  { buffer: view.camera.buffer.buffer },
624
+ material_seen,
562
625
  ]
563
626
  )
564
627
  );
@@ -600,7 +663,8 @@ export class GPUMaterialManager {
600
663
 
601
664
  pass.setBindGroup(0, material_ctx.material_binding);
602
665
 
603
- // the id rides in the instance index — the vertex stage binds nothing
666
+ // the id rides in the instance index; a material with no pixel in the view draws a
667
+ // triangle of no area, see material_gbuffer_vertex_shader_code
604
668
  pass.draw(3, 1, 0, material_ctx.material_id);
605
669
  }
606
670
 
@@ -651,6 +715,19 @@ export class GPUMaterialManager {
651
715
  })
652
716
  );
653
717
 
718
+ // a bit for every id the list holds now; one that joins before the pass runs is past the end
719
+ // and drawn as though seen
720
+ this.#gbuffer_contexts(view.scene.drawn_materials);
721
+
722
+ const id_bound = this.#lists_of(view.scene.drawn_materials).gbuffer_id_bound;
723
+ const material_seen_words = Math.max(1, Math.ceil(id_bound / 32));
724
+
725
+ pass_data.material_seen_size = material_seen_words * 4;
726
+ pass_data.material_seen = pass.create(
727
+ 'material seen',
728
+ BufferResourceDescriptor.empty(pass_data.material_seen_size, GPUBufferUsage.STORAGE)
729
+ );
730
+
654
731
  return {
655
732
  g_pbr: pass_data.g_pbr,
656
733
  g_normal: pass_data.g_normal,
@@ -867,6 +944,8 @@ export class GPUMaterialManager {
867
944
 
868
945
  contexts.length = 0;
869
946
 
947
+ let id_bound = 0;
948
+
870
949
  for (let i = 0; i < sorted.length; i++) {
871
950
  const material = sorted[i];
872
951
 
@@ -882,8 +961,11 @@ export class GPUMaterialManager {
882
961
  }
883
962
 
884
963
  contexts.push(material_ctx);
964
+
965
+ id_bound = Math.max(id_bound, material_ctx.material_id + 1);
885
966
  }
886
967
 
968
+ lists.gbuffer_id_bound = id_bound;
887
969
  lists.gbuffer_version = this.#list_version;
888
970
  }
889
971
 
@@ -10,7 +10,7 @@ export function add_g_buffer_viz_resources(group: ShaderResourceGroupDescriptor)
10
10
  * The resource set of a G-buffer pipeline whose group 0 is `material_group`.
11
11
  *
12
12
  * The group is the template's own and brings its own visibility — fragment only, because the shared
13
- * vertex stage binds nothing.
13
+ * vertex stage binds nothing of group 0.
14
14
  *
15
15
  * @param {ShaderResourceGroupDescriptor} material_group
16
16
  * @returns {ShaderResourceSetDescriptor}
@@ -51,7 +51,7 @@ export function build_gbuffer_laydown(surface: CodeChunk, derivatives: CodeChunk
51
51
  export function build_gbuffer_fragment_body(surface: CodeChunk): CodeChunk;
52
52
  /**
53
53
  * The G-buffer pipeline of a template: its group 0 and surface function around the shared body,
54
- * after the shared binding-free vertex stage.
54
+ * after the shared vertex stage.
55
55
  *
56
56
  * @param {Object} options
57
57
  * @param {string} options.label
@@ -1 +1 @@
1
- {"version":3,"file":"fragment_gbuffer.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/material/standard/fragment_gbuffer.js"],"names":[],"mappings":"AA2EA;;;;;;GAMG;AACH,kDAHW,6BAA6B,GAC3B,6BAA6B,CASzC;AAoBD;;;;;;;;GAQG;AACH,+DAHW,6BAA6B,GAC3B,2BAA2B,CAUvC;AASD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,+CALW,SAAS,eACT,SAAS,GAEP,SAAS,CA+OrB;AAgBD;;;;;;GAMG;AACH,qDAHW,SAAS,GACP,SAAS,CAerB;AAED;;;;;;;;;GASG;AACH;IAL2B,KAAK,EAArB,MAAM;IACiC,cAAc,EAArD,6BAA6B;IACV,OAAO,EAA1B,SAAS;IACP,wBAAwB,CAUpC;AAED;;;;;;;GAOG;AACH,8DAJW,MAAM,UACN,gBAAgB,GACd,wBAAwB,CA4BpC;AArbD;;;GAGG;AAGH;;;;;;;;;GASG;AACH,qCAFU,6BAA6B,CAEmC;AAwB1E;;;;GAIG;AACH,uCAFU,6BAA6B,CAEqC;AAgC5E;;;;GAIG;AACH,wCAFU,2BAA2B,CAEoE;AAyQzG;;;;;GAKG;AACH,4CAFU,SAAS,CAQhB;AAgFH;;;;GAIG;AACH,6BAFU,gBAAgB,CAMvB;8CAzc2C,wDAAwD;4CAC1D,sDAAsD;0BAFxE,oCAAoC;yCAxCrB,iEAAiE;iCA2CzE,kCAAkC"}
1
+ {"version":3,"file":"fragment_gbuffer.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/material/standard/fragment_gbuffer.js"],"names":[],"mappings":"AAkFA;;;;;;GAMG;AACH,kDAHW,6BAA6B,GAC3B,6BAA6B,CASzC;AAoBD;;;;;;;;GAQG;AACH,+DAHW,6BAA6B,GAC3B,2BAA2B,CAUvC;AASD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,+CALW,SAAS,eACT,SAAS,GAEP,SAAS,CA+OrB;AAgBD;;;;;;GAMG;AACH,qDAHW,SAAS,GACP,SAAS,CAerB;AAED;;;;;;;;;GASG;AACH;IAL2B,KAAK,EAArB,MAAM;IACiC,cAAc,EAArD,6BAA6B;IACV,OAAO,EAA1B,SAAS;IACP,wBAAwB,CAUpC;AAED;;;;;;;GAOG;AACH,8DAJW,MAAM,UACN,gBAAgB,GACd,wBAAwB,CA4BpC;AA3bD;;;GAGG;AAGH;;;;;;;;;GASG;AACH,qCAFU,6BAA6B,CAEmC;AA8B1E;;;;GAIG;AACH,uCAFU,6BAA6B,CAEqC;AAgC5E;;;;GAIG;AACH,wCAFU,2BAA2B,CAEoE;AAyQzG;;;;;GAKG;AACH,4CAFU,SAAS,CAQhB;AAgFH;;;;GAIG;AACH,6BAFU,gBAAgB,CAMvB;8CA/c2C,wDAAwD;4CAC1D,sDAAsD;0BAFxE,oCAAoC;yCAxCrB,iEAAiE;iCA2CzE,kCAAkC"}
@@ -1,3 +1,4 @@
1
+ import { assert } from "../../../../core/assert.js";
1
2
  import { GPUShaderStage } from "../../../descriptor/GPUShaderStage.js";
2
3
  import { RenderPipelineDescriptor } from "../../../descriptor/pipeline/render/RenderPipelineDescriptor.js";
3
4
  import { G_BUFFER_COLOR_TARGETS } from "../../gbuffer/G_BUFFER_COLOR_TARGETS.js";
@@ -46,7 +47,7 @@ import { ShaderDescriptor } from "../../shader/ShaderDescriptor.js";
46
47
  import { VIEW_UNIFORM_STRUCT } from "../../view/VIEW_UNIFORM_STRUCT.js";
47
48
  import { chunk_material_surface_contract } from "../template/chunk_material_surface.js";
48
49
  import { chunk_standard_material_surface } from "./chunk_standard_material_surface.js";
49
- import { material_gbuffer_vertex_shader_code } from "./material_gbuffer_vertex.js";
50
+ import { MATERIAL_SEEN_BINDING, material_gbuffer_vertex_shader_code } from "./material_gbuffer_vertex.js";
50
51
  import { SHADING_MATERIAL_RESOURCE_GROUP } from "./SHADING_MATERIAL_RESOURCE_GROUP.js";
51
52
 
52
53
  /**
@@ -73,6 +74,12 @@ add_g_buffer_viz_resources(g_buffer_viz_resources);
73
74
 
74
75
  g_buffer_viz_resources.addVisibility(GPUShaderStage.FRAGMENT);
75
76
 
77
+ // which materials hold a pixel of the view, a bit per material id; the shared vertex stage reads it
78
+ g_buffer_viz_resources.addStorageBuffer("material_seen", WebGPUArray.from(u32));
79
+ g_buffer_viz_resources.get("material_seen").addVisibility(GPUShaderStage.VERTEX);
80
+
81
+ assert.equal(g_buffer_viz_resources.get("material_seen").binding_index, MATERIAL_SEEN_BINDING, "material_seen binding");
82
+
76
83
  /**
77
84
  * Declare in `group` what {@link build_gbuffer_laydown} reads of the visibility buffer and the
78
85
  * view that drew it: the first four bindings of group 1, under the names the body reads them by.
@@ -111,7 +118,7 @@ g_buffer_scene_resources.addVisibility(GPUShaderStage.FRAGMENT);
111
118
  * The resource set of a G-buffer pipeline whose group 0 is `material_group`.
112
119
  *
113
120
  * The group is the template's own and brings its own visibility — fragment only, because the shared
114
- * vertex stage binds nothing.
121
+ * vertex stage binds nothing of group 0.
115
122
  *
116
123
  * @param {ShaderResourceGroupDescriptor} material_group
117
124
  * @returns {ShaderResourceSetDescriptor}
@@ -434,7 +441,7 @@ fn main(
434
441
 
435
442
  /**
436
443
  * The G-buffer pipeline of a template: its group 0 and surface function around the shared body,
437
- * after the shared binding-free vertex stage.
444
+ * after the shared vertex stage.
438
445
  *
439
446
  * @param {Object} options
440
447
  * @param {string} options.label
@@ -1,11 +1,23 @@
1
+ /**
2
+ * Group 1 binding of the material-seen bitset the shared G-buffer vertex stage reads: bit
3
+ * `id & 31` of word `id >> 5` is set when material `id` holds a pixel of the view.
4
+ *
5
+ * @type {number}
6
+ */
7
+ export const MATERIAL_SEEN_BINDING: number;
1
8
  /**
2
9
  * Shared vertex stage of every material template's G-buffer pipeline: a fullscreen triangle placed
3
10
  * at depth `material.id / 2^24`, matched against the material-depth mask with `depthCompare: 'equal'`
4
11
  * so the fragment stage only runs on this material's pixels.
5
12
  *
6
- * **It binds nothing.** The material id rides in the instance index — the material pass draws
7
- * `draw(3, 1, 0, id)` — so a template's group 0 can be laid out however the template needs, and is
8
- * visible to the fragment stage alone. A direct draw's `firstInstance` needs no device feature.
13
+ * The material id rides in the instance index — the material pass draws `draw(3, 1, 0, id)` — so a
14
+ * template's group 0 can be laid out however the template needs, and is visible to the fragment
15
+ * stage alone. A direct draw's `firstInstance` needs no device feature.
16
+ *
17
+ * A material that holds no pixel of the view — its bit clear in `material_seen`, of the shared group
18
+ * 1 — gets all three corners on one point: a triangle of no area, which rasterizes nothing, so the
19
+ * draw costs three vertex invocations rather than a fullscreen pass of depth tests. An id past the
20
+ * end of the bitset is drawn.
9
21
  *
10
22
  * `id / 16777216` is the expression the material-depth pass writes, and a division by a power of two
11
23
  * is exact for every id below 2^24, so the two meet at depth-equal.
@@ -1 +1 @@
1
- {"version":3,"file":"material_gbuffer_vertex.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/material/standard/material_gbuffer_vertex.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,kDAFU,MAAM,CA6BE"}
1
+ {"version":3,"file":"material_gbuffer_vertex.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/material/standard/material_gbuffer_vertex.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,oCAFU,MAAM,CAEuB;AAEvC;;;;;;;;;;;;;;;;;;GAkBG;AACH,kDAFU,MAAM,CAqCE"}
@@ -1,13 +1,26 @@
1
1
  import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
2
2
 
3
+ /**
4
+ * Group 1 binding of the material-seen bitset the shared G-buffer vertex stage reads: bit
5
+ * `id & 31` of word `id >> 5` is set when material `id` holds a pixel of the view.
6
+ *
7
+ * @type {number}
8
+ */
9
+ export const MATERIAL_SEEN_BINDING = 4;
10
+
3
11
  /**
4
12
  * Shared vertex stage of every material template's G-buffer pipeline: a fullscreen triangle placed
5
13
  * at depth `material.id / 2^24`, matched against the material-depth mask with `depthCompare: 'equal'`
6
14
  * so the fragment stage only runs on this material's pixels.
7
15
  *
8
- * **It binds nothing.** The material id rides in the instance index — the material pass draws
9
- * `draw(3, 1, 0, id)` — so a template's group 0 can be laid out however the template needs, and is
10
- * visible to the fragment stage alone. A direct draw's `firstInstance` needs no device feature.
16
+ * The material id rides in the instance index — the material pass draws `draw(3, 1, 0, id)` — so a
17
+ * template's group 0 can be laid out however the template needs, and is visible to the fragment
18
+ * stage alone. A direct draw's `firstInstance` needs no device feature.
19
+ *
20
+ * A material that holds no pixel of the view — its bit clear in `material_seen`, of the shared group
21
+ * 1 — gets all three corners on one point: a triangle of no area, which rasterizes nothing, so the
22
+ * draw costs three vertex invocations rather than a fullscreen pass of depth tests. An id past the
23
+ * end of the bitset is drawn.
11
24
  *
12
25
  * `id / 16777216` is the expression the material-depth pass writes, and a division by a power of two
13
26
  * is exact for every id below 2^24, so the two meet at depth-equal.
@@ -17,6 +30,8 @@ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
17
30
  export const material_gbuffer_vertex_shader_code = CodeChunk.from(
18
31
  // language=WGSL
19
32
  `
33
+ @group(1) @binding(${MATERIAL_SEEN_BINDING}) var<storage, read> material_seen: array<u32>;
34
+
20
35
  const pos : array< vec2<f32>, 3 > = array< vec2<f32>, 3 >(
21
36
  vec2<f32>(-1.0, -1.0),
22
37
  vec2<f32>(3.0, -1.0),
@@ -35,7 +50,13 @@ fn main(
35
50
 
36
51
  var out: VertexOutput;
37
52
 
38
- let ndc = pos[id];
53
+ let word = material_id >> 5u;
54
+
55
+ // an id past the bitset was not counted, so it is drawn as though seen
56
+ let seen = word >= arrayLength(&material_seen)
57
+ || (material_seen[word] & (1u << (material_id & 31u))) != 0u;
58
+
59
+ let ndc = select(pos[0], pos[id], seen);
39
60
 
40
61
  out.position = vec4<f32>(ndc, f32(material_id)/16777216 , 1.0);
41
62
 
@@ -100,6 +100,17 @@
100
100
  * and a set of accumulators that are sums — so the particles need no depth ordering at all, and
101
101
  * none is ever built.
102
102
  *
103
+ * ## Capacity
104
+ *
105
+ * {@link capacity} may be set at any time and takes effect on the next {@link execute}, which is
106
+ * where every buffer it sizes is replaced — never while a recorded graph may still read the old
107
+ * ones. Growing keeps every live particle: the pool and the free list are copied into the larger
108
+ * buffers and the new slots pushed onto the free list. Shrinking keeps every live particle the
109
+ * smaller pool can hold: a particle in a slot past the new capacity moves into a free slot below
110
+ * it, and when there are more particles than slots, the excess is dropped. A particle that moves
111
+ * reads a new `PARTICLE_INDEX`, and the frame that applies a shrink rebuilds the simulation order
112
+ * from the moved list before it simulates.
113
+ *
103
114
  * ## Allocation
104
115
  *
105
116
  * The per-frame path allocates the frame graph's records and nothing else: emitter rows are
@@ -130,11 +141,6 @@ export class GPUParticleSystem {
130
141
  * @type {import("../scene/GPUSceneContext.js").GPUSceneContext}
131
142
  */
132
143
  scene_context: import("../scene/GPUSceneContext.js").GPUSceneContext;
133
- /**
134
- * Maximum number of simultaneously live particles.
135
- * @type {number}
136
- */
137
- capacity: number;
138
144
  /**
139
145
  * @type {EmitterRegistry}
140
146
  */
@@ -175,6 +181,18 @@ export class GPUParticleSystem {
175
181
  * @type {object}
176
182
  */
177
183
  buffers: object;
184
+ /**
185
+ * Raise or lower the number of particles the pool holds. Applied by the next {@link execute};
186
+ * see the class doc for what happens to the particles already live.
187
+ *
188
+ * @param {number} value
189
+ */
190
+ set capacity(value: number);
191
+ /**
192
+ * Maximum number of simultaneously live particles.
193
+ * @returns {number}
194
+ */
195
+ get capacity(): number;
178
196
  /**
179
197
  * The buffer the emitter table lives in — what every emitter-reading pass binds.
180
198
  * @returns {GPUBuffer}
@@ -1 +1 @@
1
- {"version":3,"file":"GPUParticleSystem.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/particles/GPUParticleSystem.js"],"names":[],"mappings":"AA6DA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8FG;AACH;IAsLI;;;;;;OAMG;IACH,sBANW,MAAM,iBAC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CAAC,CA8BxC;IAED,gBA2BC;;CACJ;;;;;;;;WAprCa,MAAM;;;;UACN,MAAM;;;;kBACN,MAAM;;;;;cACN,MAAM;;;;;gBAEN,MAAM;;;;;oBAEN,MAAM;;gCAxCY,8BAA8B"}
1
+ {"version":3,"file":"GPUParticleSystem.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/particles/GPUParticleSystem.js"],"names":[],"mappings":"AAwEA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyGG;AACH;IA2MI;;;;;;OAMG;IACH,sBANW,MAAM,iBACN,OAAO,6BAA6B,EAAE,eAAe;QAEpC,QAAQ,GAAzB,MAAM;QACW,sBAAsB,GAAvC,MAAM;OAqBhB;IAnOD;;;OAGG;IACH,UAFU,MAAM,CAEP;IAET;;;;OAIG;IACH,eAFU,OAAO,6BAA6B,EAAE,eAAe,CAEjD;IA6Bd;;OAEG;IACH,UAFU,eAAe,CAEhB;IAET;;;OAGG;IACH,OAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,MAFU,MAAM,CAEP;IAET;;;OAGG;IACH,qBAFU,MAAM,CAEQ;IAExB;;;;OAIG;IACH,sBAAM;IAEN,yBAAyB;IACzB,0BAAc;IAEd;;;;;;;;;;;OAWG;IACH,SAFU,MAAM,CAEH;IAwJb;;;;;OAKG;IACH,4BAIC;IAlBD;;;OAGG;IACH,uBAEC;IAcD;;;OAGG;IACH,kCAEC;IAED;;;OAGG;IACH,yEAEC;IAED;;;;;OAKG;IACH,sFAEC;IAED;;;;;;;;;;;;OAYG;IACH,eAFa,MAAM,CAIlB;IAED;;;;;;;OAOG;IACH,eAHW,OAAO,8BAA8B,EAAE,eAAe,SACtD,MAAM,QAwBhB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH;QAPkG,KAA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