@woosh/meep-engine 3.59.0 → 3.60.0
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/package.json +1 -1
- package/src/shade/playground/probe_clipmap/index.html +12 -0
- package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
- package/src/shade/playground/probe_clipmap/main.js +5 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +4 -6
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +63 -1
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +228 -16
- package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts +27 -4
- package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.js +526 -23
- package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.d.ts +11 -0
- package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.js +21 -0
- package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.d.ts +65 -0
- package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.js +376 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.d.ts +7 -3
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.js +70 -6
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.d.ts +20 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.js +80 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.d.ts +18 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.d.ts.map +1 -0
- package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.js +113 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.d.ts +47 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.js +80 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.d.ts +91 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.js +902 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.d.ts +16 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.js +67 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.d.ts +17 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.js +145 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.d.ts +12 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.js +105 -0
- package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.js +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +3 -9
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +13 -31
- package/src/shade/renderer/global_illumination/probe_clipmap/PROBE_CLIPMAP_PROPOSAL_2026_10_27.md +764 -48
- package/src/shade/renderer/global_illumination/probe_clipmap/PROBE_RAYS_VARIABLE_AND_SORTED_SCOPE_2026_10_30.md +410 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts +3 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.js +4 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +41 -17
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +57 -33
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.d.ts +11 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.js +13 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +9 -18
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.js +8 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.d.ts +12 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.js +28 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +1 -29
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +1 -74
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts +161 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.js +219 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK_INSTANCE_STRUCT.d.ts +1 -8
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK_INSTANCE_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK_INSTANCE_STRUCT.js +1 -9
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts +40 -12
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.js +373 -31
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.d.ts +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.js +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.d.ts +15 -8
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.js +28 -14
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts +23 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.js +66 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.d.ts +29 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.js +210 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_command.d.ts +29 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_command.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_command.js +86 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts +41 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.js +439 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.d.ts +23 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.js +135 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.d.ts +3 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.js +12 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +21 -18
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js +254 -73
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts +149 -8
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.js +181 -13
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts +179 -7
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.js +412 -31
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.js +4 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js +4 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts +36 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.js +218 -29
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts +5 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.js +24 -14
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts +15 -6
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.js +21 -22
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.d.ts +36 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.js +257 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts +18 -7
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js +157 -51
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.d.ts +23 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.js +110 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts +24 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js +90 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.d.ts +45 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.js +205 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.js +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_retire.d.ts +16 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_retire.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_retire.js +55 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.d.ts +19 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.js +60 -6
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts +4 -8
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js +21 -36
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts +21 -14
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js +100 -30
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.d.ts +6 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.js +26 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts +3 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.js +12 -12
- package/src/shade/renderer/gpu_primitive/sort/SORT_DIGIT_SETTINGS_STRUCT.d.ts +10 -0
- package/src/shade/renderer/gpu_primitive/sort/SORT_DIGIT_SETTINGS_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/SORT_DIGIT_SETTINGS_STRUCT.js +21 -0
- package/src/shade/renderer/gpu_primitive/sort/SORT_PASS_SETTINGS_STRUCT.d.ts +5 -2
- package/src/shade/renderer/gpu_primitive/sort/SORT_PASS_SETTINGS_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/SORT_PASS_SETTINGS_STRUCT.js +31 -23
- package/src/shade/renderer/gpu_primitive/sort/SORT_SIZE_STRUCT.d.ts +10 -0
- package/src/shade/renderer/gpu_primitive/sort/SORT_SIZE_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/SORT_SIZE_STRUCT.js +22 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_constants.d.ts +9 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_constants.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_constants.js +18 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_digit.d.ts +8 -3
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_digit.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_digit.js +41 -32
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_histogram_tile.d.ts +31 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_histogram_tile.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_histogram_tile.js +71 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_scatter_tile.d.ts +47 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_scatter_tile.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/chunk_sort_scatter_tile.js +210 -0
- package/src/shade/renderer/gpu_primitive/sort/defs.d.ts +5 -4
- package/src/shade/renderer/gpu_primitive/sort/defs.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/defs.js +5 -4
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts +56 -15
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.js +410 -61
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram.d.ts +4 -1
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram.js +16 -42
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram_indirect.d.ts +15 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram_indirect.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram_indirect.js +60 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_prepare.d.ts +25 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_prepare.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_prepare.js +89 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter.d.ts +3 -8
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter.js +28 -160
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter_indirect.d.ts +12 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter_indirect.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter_indirect.js +74 -0
- package/src/shade/renderer/gpu_primitive/sort/verify_radix_sort.d.ts +3 -1
- package/src/shade/renderer/gpu_primitive/sort/verify_radix_sort.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/verify_radix_sort.js +387 -188
- package/src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_irradiance_flat.js +1 -1
- package/src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_sh.js +1 -1
- package/src/shade/renderer/material/resident/GPUResidentMaterialContext.d.ts.map +1 -1
- package/src/shade/renderer/material/resident/GPUResidentMaterialContext.js +90 -72
- package/src/shade/renderer/material/resident/RESIDENT_MATERIAL_TEXTURE_LAYOUT.d.ts +5 -0
- package/src/shade/renderer/material/resident/RESIDENT_MATERIAL_TEXTURE_LAYOUT.d.ts.map +1 -1
- package/src/shade/renderer/material/resident/RESIDENT_MATERIAL_TEXTURE_LAYOUT.js +9 -0
- package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.d.ts +13 -0
- package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.d.ts.map +1 -0
- package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.js +14 -0
- package/src/shade/renderer/path_tracer/shader/IndirectTextureFilter.d.ts +10 -0
- package/src/shade/renderer/path_tracer/shader/IndirectTextureFilter.d.ts.map +1 -0
- package/src/shade/renderer/path_tracer/shader/IndirectTextureFilter.js +15 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_tangent_normal.d.ts +4 -3
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_tangent_normal.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_tangent_normal.js +6 -5
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture.d.ts +17 -2
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture.js +25 -57
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_exact.d.ts +13 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_exact.d.ts.map +1 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_exact.js +70 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_stochastic.d.ts +10 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_stochastic.d.ts.map +1 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_stochastic.js +59 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_texture_load.d.ts +12 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_texture_load.d.ts.map +1 -0
- package/src/shade/renderer/path_tracer/shader/chunk_indirect_texture_load.js +49 -0
- package/src/shade/renderer/path_tracer/shader/chunk_ray_hit_to_opacity.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_ray_hit_to_opacity.js +1 -0
- package/src/shade/renderer/path_tracer/shader/chunk_render_trace_path.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_render_trace_path.js +1 -0
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material.js +2 -1
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.d.ts +7 -0
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.js +15 -6
- package/src/shade/renderer/scene/GPUSceneContext.d.ts +7 -1
- package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
- package/src/shade/renderer/scene/GPUSceneContext.js +26 -1
- package/src/shade/renderer/shader/chunk/bvh/chunk_bvh_query_aabb_cooperative.d.ts +7 -7
- package/src/shade/renderer/shader/chunk/bvh/chunk_bvh_query_aabb_cooperative.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/bvh/chunk_bvh_query_aabb_cooperative.js +262 -294
- package/src/shade/renderer/shader/chunk/filter/MULTISCALE_MEAN_STRUCT.d.ts +9 -0
- package/src/shade/renderer/shader/chunk/filter/MULTISCALE_MEAN_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/filter/MULTISCALE_MEAN_STRUCT.js +21 -0
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts +43 -0
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.js +87 -0
- package/src/shade/renderer/shader/chunk/noise/r/chunk_r2_canonical.d.ts +7 -1
- package/src/shade/renderer/shader/chunk/noise/r/chunk_r2_canonical.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/noise/r/chunk_r2_canonical.js +1 -1
- package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_reserve_workgroup.d.ts +21 -0
- package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_reserve_workgroup.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_reserve_workgroup.js +42 -0
- package/src/shade/renderer/wind/GPUSceneWind.d.ts +1 -1
- package/src/shade/wgsl/emulator/CPUBitmapData.d.ts +19 -0
- package/src/shade/wgsl/emulator/CPUBitmapData.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/CPUBitmapData.js +27 -0
- package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.js +39 -18
- package/src/view/elements/progress/segmented/GhostTrail.d.ts +56 -0
- package/src/view/elements/progress/segmented/GhostTrail.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/GhostTrail.js +98 -0
- package/src/view/elements/progress/segmented/RESOURCE_BAR_SEGMENTS.d.ts +3 -1
- package/src/view/elements/progress/segmented/RESOURCE_BAR_SEGMENTS.d.ts.map +1 -1
- package/src/view/elements/progress/segmented/RESOURCE_BAR_SEGMENTS.js +3 -1
- package/src/view/elements/progress/segmented/SEGMENT_TIERS_DEFAULT.d.ts +11 -0
- package/src/view/elements/progress/segmented/SEGMENT_TIERS_DEFAULT.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/SEGMENT_TIERS_DEFAULT.js +15 -0
- package/src/view/elements/progress/segmented/SegmentDefinition.d.ts +3 -0
- package/src/view/elements/progress/segmented/SegmentDefinition.d.ts.map +1 -1
- package/src/view/elements/progress/segmented/SegmentDefinition.js +3 -0
- package/src/view/elements/progress/segmented/SegmentTier.d.ts +38 -0
- package/src/view/elements/progress/segmented/SegmentTier.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/SegmentTier.js +50 -0
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.d.ts +155 -10
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.d.ts.map +1 -1
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.js +427 -101
- package/src/view/elements/progress/segmented/playground/index.html +78 -0
- package/src/view/elements/progress/segmented/playground/main.d.ts +2 -0
- package/src/view/elements/progress/segmented/playground/main.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/playground/main.js +173 -0
- package/src/view/elements/progress/segmented/segment_cell_layout.d.ts +48 -0
- package/src/view/elements/progress/segmented/segment_cell_layout.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/segment_cell_layout.js +75 -0
- package/src/view/elements/progress/segmented/segment_notch_place.d.ts +18 -0
- package/src/view/elements/progress/segmented/segment_notch_place.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/segment_notch_place.js +28 -0
- package/src/view/elements/progress/segmented/segment_tick_positions.d.ts +32 -0
- package/src/view/elements/progress/segmented/segment_tick_positions.d.ts.map +1 -0
- package/src/view/elements/progress/segmented/segment_tick_positions.js +103 -0
- package/src/view/elements/progress/segmented/segmented-resource-bar.css +142 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_provider.d.ts +0 -35
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_provider.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_provider.js +0 -238
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGEO_BRICK.d.ts +0 -99
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGEO_BRICK.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGEO_BRICK.js +0 -139
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGeoBrickProvider.d.ts +0 -65
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGeoBrickProvider.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGeoBrickProvider.js +0 -393
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_box.d.ts +0 -17
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_box.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_box.js +0 -36
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_pair.d.ts +0 -29
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_pair.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_pair.js +0 -108
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_texel.d.ts +0 -31
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_texel.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_texel.js +0 -113
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_triangle.d.ts +0 -36
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_triangle.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_triangle.js +0 -85
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_distance.d.ts +0 -23
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_distance.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_distance.js +0 -273
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_gather.d.ts +0 -13
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_gather.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_gather.js +0 -151
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_traverse.d.ts +0 -13
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_traverse.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_traverse.js +0 -133
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_wait.d.ts +0 -22
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_wait.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_wait.js +0 -135
|
@@ -4,7 +4,14 @@ import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
|
4
4
|
import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
5
5
|
import { u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
6
6
|
import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
chunk_probe_clipmap,
|
|
9
|
+
PROBE_DISPATCH_RESOURCE,
|
|
10
|
+
PROBE_RAY_COUNTS_WRITE_RESOURCE,
|
|
11
|
+
PROBE_RAY_REQUESTS_WRITE_RESOURCE,
|
|
12
|
+
PROBE_RAY_SUMS_WRITE_RESOURCE,
|
|
13
|
+
PROBE_TRACE_READ_RESOURCE
|
|
14
|
+
} from "./chunk_probe_clipmap.js";
|
|
8
15
|
|
|
9
16
|
/**
|
|
10
17
|
* @type {WebGPUStruct}
|
|
@@ -12,8 +19,6 @@ import { chunk_probe_clipmap, PROBE_DISPATCH_RESOURCE, PROBE_TRACE_READ_RESOURCE
|
|
|
12
19
|
export const PROBE_TRACE_COMMAND_SETTINGS = WebGPUStruct.from({
|
|
13
20
|
/** probes a frame updates at most: the trace list's bound */
|
|
14
21
|
trace_capacity: u32,
|
|
15
|
-
/** rays an update casts, R */
|
|
16
|
-
rays_per_probe: u32,
|
|
17
22
|
/** octahedral radiance texels a side, n_r */
|
|
18
23
|
radiance_resolution: u32,
|
|
19
24
|
/** octahedral depth texels a side, n_d */
|
|
@@ -26,17 +31,24 @@ resources.setImmediate("settings", PROBE_TRACE_COMMAND_SETTINGS);
|
|
|
26
31
|
|
|
27
32
|
resources.createGroup()
|
|
28
33
|
.add(PROBE_TRACE_READ_RESOURCE)
|
|
34
|
+
.add(PROBE_RAY_COUNTS_WRITE_RESOURCE)
|
|
35
|
+
.add(PROBE_RAY_REQUESTS_WRITE_RESOURCE)
|
|
36
|
+
.add(PROBE_RAY_SUMS_WRITE_RESOURCE)
|
|
29
37
|
.add(PROBE_DISPATCH_RESOURCE);
|
|
30
38
|
|
|
31
39
|
/**
|
|
32
40
|
* The update's commands (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.5): one thread, once the due passes
|
|
33
41
|
* have listed the frame's updates, the list's count clamped to U:
|
|
34
|
-
* - a thread a listed probe, at `PROBE_DISPATCH_TRACED`: relocation and the probes'
|
|
35
|
-
*
|
|
42
|
+
* - a thread a listed probe, at `PROBE_DISPATCH_TRACED`: relocation, the ray counts and the probes'
|
|
43
|
+
* projection;
|
|
36
44
|
* - a thread a texel of their maps, n_r² + n_d² a probe, at `PROBE_DISPATCH_TEXELS`: accumulate;
|
|
37
45
|
* - a thread a row of their radiance maps, n_r a probe, at `PROBE_DISPATCH_ROWS`: the projection's rows;
|
|
38
46
|
* - a thread a texel of their tiles, (n_r + 2)² + (n_d + 2)² a probe, at `PROBE_DISPATCH_PUBLISH`.
|
|
39
47
|
*
|
|
48
|
+
* It writes the count of the ray counts, the ray requests and the rays' layout, the probes listed, which
|
|
49
|
+
* the passes after fill in (`shader_probe_clipmap_ray_layout.js`): a probe's rays are its own update's,
|
|
50
|
+
* even when none is listed.
|
|
51
|
+
*
|
|
40
52
|
* @type {ComputeShader}
|
|
41
53
|
*/
|
|
42
54
|
export const shader_probe_clipmap_trace_command = ComputeShader.from({
|
|
@@ -54,11 +66,9 @@ fn main() {
|
|
|
54
66
|
probe_dispatch[PROBE_DISPATCH_TRACED + 1u] = probes.y;
|
|
55
67
|
probe_dispatch[PROBE_DISPATCH_TRACED + 2u] = probes.z;
|
|
56
68
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
probe_dispatch[PROBE_DISPATCH_RAYS + 1u] = rays.y;
|
|
61
|
-
probe_dispatch[PROBE_DISPATCH_RAYS + 2u] = rays.z;
|
|
69
|
+
probe_ray_counts.count = traced;
|
|
70
|
+
probe_ray_requests.count = traced;
|
|
71
|
+
probe_ray_sums.count = traced;
|
|
62
72
|
|
|
63
73
|
let n = settings.radiance_resolution;
|
|
64
74
|
let m = settings.depth_resolution;
|
|
@@ -80,6 +90,12 @@ fn main() {
|
|
|
80
90
|
probe_dispatch[PROBE_DISPATCH_PUBLISH] = tiles.x;
|
|
81
91
|
probe_dispatch[PROBE_DISPATCH_PUBLISH + 1u] = tiles.y;
|
|
82
92
|
probe_dispatch[PROBE_DISPATCH_PUBLISH + 2u] = tiles.z;
|
|
93
|
+
|
|
94
|
+
let runs = folded_dispatch((traced + PROBE_ORDER_RUN - 1u) / PROBE_ORDER_RUN);
|
|
95
|
+
|
|
96
|
+
probe_dispatch[PROBE_DISPATCH_ORDER] = runs.x;
|
|
97
|
+
probe_dispatch[PROBE_DISPATCH_ORDER + 1u] = runs.y;
|
|
98
|
+
probe_dispatch[PROBE_DISPATCH_ORDER + 2u] = runs.z;
|
|
83
99
|
}
|
|
84
100
|
`, [
|
|
85
101
|
chunk_probe_clipmap,
|
|
@@ -16,8 +16,9 @@ export const PROBE_WANT_HITS_SETTINGS: WebGPUStruct;
|
|
|
16
16
|
* want nothing in turn: the chain stops after one step, as Enshrouded's world-cache probes do. Unstopped,
|
|
17
17
|
* hits would want a probe at every surface the windows hold, the dense lattice D31 turned down.
|
|
18
18
|
*
|
|
19
|
-
* It binds the last frame's trace list, origins and rays, which the frame's trace writes over later
|
|
20
|
-
*
|
|
19
|
+
* It binds the last frame's trace list, origins and rays, which the frame's trace writes over later. A ray
|
|
20
|
+
* names its probe, its place in that list, in its flags; a record of no ray (`PROBE_RAY_NONE`) is past
|
|
21
|
+
* that frame's last.
|
|
21
22
|
*
|
|
22
23
|
* @type {ComputeShader}
|
|
23
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_want_hits.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_want_hits.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.js"],"names":[],"mappings":"AAqBA;;GAEG;AACH,uCAFU,YAAY,CAQM;AAe5B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,6CAFU,aAAa,CA8CpB;6BAvG0B,sCAAsC;8BAHrC,kCAAkC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.js
CHANGED
|
@@ -7,6 +7,7 @@ import { u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
|
7
7
|
import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
|
|
8
8
|
import {
|
|
9
9
|
chunk_probe_clipmap,
|
|
10
|
+
chunk_probe_clipmap_ray_origin,
|
|
10
11
|
PROBE_LEVELS_RESOURCE,
|
|
11
12
|
PROBE_ORIGINS_READ_RESOURCE,
|
|
12
13
|
PROBE_RAYS_READ_RESOURCE,
|
|
@@ -27,10 +28,6 @@ export const PROBE_WANT_HITS_SETTINGS = WebGPUStruct.from({
|
|
|
27
28
|
resolution: u32,
|
|
28
29
|
/** keys over every cascade: what the wanted list holds at most */
|
|
29
30
|
key_count: u32,
|
|
30
|
-
/** the trace list's bound in the rays' frame, its U */
|
|
31
|
-
trace_capacity: u32,
|
|
32
|
-
/** rays an update in the rays' frame, its R */
|
|
33
|
-
rays_per_probe: u32,
|
|
34
31
|
}, "ProbeWantHitsSettings");
|
|
35
32
|
|
|
36
33
|
const resources = new ShaderResourceSetDescriptor();
|
|
@@ -60,8 +57,9 @@ resources.createGroup()
|
|
|
60
57
|
* want nothing in turn: the chain stops after one step, as Enshrouded's world-cache probes do. Unstopped,
|
|
61
58
|
* hits would want a probe at every surface the windows hold, the dense lattice D31 turned down.
|
|
62
59
|
*
|
|
63
|
-
* It binds the last frame's trace list, origins and rays, which the frame's trace writes over later
|
|
64
|
-
*
|
|
60
|
+
* It binds the last frame's trace list, origins and rays, which the frame's trace writes over later. A ray
|
|
61
|
+
* names its probe, its place in that list, in its flags; a record of no ray (`PROBE_RAY_NONE`) is past
|
|
62
|
+
* that frame's last.
|
|
65
63
|
*
|
|
66
64
|
* @type {ComputeShader}
|
|
67
65
|
*/
|
|
@@ -77,24 +75,25 @@ fn main(
|
|
|
77
75
|
@builtin(local_invocation_index) lane: u32,
|
|
78
76
|
) {
|
|
79
77
|
let ray = folded_workgroup_index(workgroup_id) * PROBE_THREAD_WORKGROUP_SIZE + lane;
|
|
80
|
-
let rays = settings.rays_per_probe;
|
|
81
78
|
|
|
82
79
|
var wants = false;
|
|
83
80
|
var position = vec3<f32>(0.0);
|
|
84
81
|
var bias_direction = vec3<f32>(0.0);
|
|
85
82
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
let record = probe_rays[ray];
|
|
84
|
+
|
|
85
|
+
if ((record.flags & PROBE_RAY_KIND_MASK) != PROBE_RAY_NONE) {
|
|
86
|
+
let k = record.flags >> PROBE_RAY_PROBE_SHIFT;
|
|
87
|
+
let slot = probe_trace.elements[k];
|
|
89
88
|
|
|
90
89
|
// shade left a front-face hit's albedo in its row and zero in any other ray's: a ray that takes no
|
|
91
90
|
// bounce, a black hit's among them, wants nothing
|
|
92
|
-
wants = record.row != 0u && probe_records[slot].
|
|
91
|
+
wants = record.row != 0u && (probe_records[slot].flags & PROBE_RECORD_SCREEN) != 0u;
|
|
93
92
|
|
|
94
93
|
let direction = uv_octahedral_unit_decode(unpack2x16unorm(record.direction));
|
|
95
94
|
let normal = uv_octahedral_unit_decode(unpack2x16unorm(record.normal));
|
|
96
95
|
|
|
97
|
-
position = probe_origins[
|
|
96
|
+
position = probe_clipmap_ray_origin(probe_origins[k], slot, record.direction) + record.t * direction;
|
|
98
97
|
// the view back along the ray, as the light pass's pick takes it
|
|
99
98
|
bias_direction = mix(normal, -direction, ${PROBE_RECEIVER_BIAS_VIEW});
|
|
100
99
|
}
|
|
@@ -103,6 +102,7 @@ fn main(
|
|
|
103
102
|
}
|
|
104
103
|
`, [
|
|
105
104
|
chunk_probe_clipmap,
|
|
105
|
+
chunk_probe_clipmap_ray_origin,
|
|
106
106
|
chunk_folded_workgroup_index,
|
|
107
107
|
chunk_uv_octahedral_unit_decode,
|
|
108
108
|
chunk_probe_clipmap_want,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-digit-pass constants of a sort over a device count, shared by
|
|
3
|
+
* {@link shader_radix_sort_histogram_indirect} and {@link shader_radix_sort_scatter_indirect}. The
|
|
4
|
+
* host knows these; the size of the input it does not, and that lives in {@link SORT_SIZE_STRUCT}.
|
|
5
|
+
*
|
|
6
|
+
* @type {WebGPUStruct}
|
|
7
|
+
*/
|
|
8
|
+
export const SORT_DIGIT_SETTINGS_STRUCT: WebGPUStruct;
|
|
9
|
+
import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
|
|
10
|
+
//# sourceMappingURL=SORT_DIGIT_SETTINGS_STRUCT.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SORT_DIGIT_SETTINGS_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/gpu_primitive/sort/SORT_DIGIT_SETTINGS_STRUCT.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,yCAFU,YAAY,CAYE;6BAnBK,mCAAmC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { u32 } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
2
|
+
import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Per-digit-pass constants of a sort over a device count, shared by
|
|
6
|
+
* {@link shader_radix_sort_histogram_indirect} and {@link shader_radix_sort_scatter_indirect}. The
|
|
7
|
+
* host knows these; the size of the input it does not, and that lives in {@link SORT_SIZE_STRUCT}.
|
|
8
|
+
*
|
|
9
|
+
* @type {WebGPUStruct}
|
|
10
|
+
*/
|
|
11
|
+
export const SORT_DIGIT_SETTINGS_STRUCT = WebGPUStruct.from({
|
|
12
|
+
/**
|
|
13
|
+
* Bit position of the digit this pass sorts on — 0, 8, 16, 24.
|
|
14
|
+
*/
|
|
15
|
+
shift: u32,
|
|
16
|
+
/**
|
|
17
|
+
* The key's bits, `key_bits` of them set from the bottom: what a digit is selected from. See
|
|
18
|
+
* `sort_extract_key_digit` in {@link chunk_sort_digit}.
|
|
19
|
+
*/
|
|
20
|
+
key_mask: u32,
|
|
21
|
+
}, "SortDigitSettings");
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Per-digit-pass constants, shared by the histogram and the scatter so
|
|
3
|
-
* exist and where their counts live in the spine.
|
|
2
|
+
* Per-digit-pass constants of a sort over a host count, shared by the histogram and the scatter so
|
|
3
|
+
* the two agree on which keys exist and where their counts live in the spine.
|
|
4
|
+
*
|
|
5
|
+
* A sort over a device count reads `element_count` and `tile_count` from {@link SORT_SIZE_STRUCT}
|
|
6
|
+
* instead, and carries the rest as {@link SORT_DIGIT_SETTINGS_STRUCT}.
|
|
4
7
|
*
|
|
5
8
|
* @type {WebGPUStruct}
|
|
6
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SORT_PASS_SETTINGS_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/gpu_primitive/sort/SORT_PASS_SETTINGS_STRUCT.js"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"SORT_PASS_SETTINGS_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/gpu_primitive/sort/SORT_PASS_SETTINGS_STRUCT.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wCAFU,YAAY,CAoBC;6BA7BM,mCAAmC"}
|
|
@@ -1,23 +1,31 @@
|
|
|
1
|
-
import { u32 } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
2
|
-
import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Per-digit-pass constants, shared by the histogram and the scatter so
|
|
6
|
-
* exist and where their counts live in the spine.
|
|
7
|
-
*
|
|
8
|
-
* @
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import { u32 } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
2
|
+
import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Per-digit-pass constants of a sort over a host count, shared by the histogram and the scatter so
|
|
6
|
+
* the two agree on which keys exist and where their counts live in the spine.
|
|
7
|
+
*
|
|
8
|
+
* A sort over a device count reads `element_count` and `tile_count` from {@link SORT_SIZE_STRUCT}
|
|
9
|
+
* instead, and carries the rest as {@link SORT_DIGIT_SETTINGS_STRUCT}.
|
|
10
|
+
*
|
|
11
|
+
* @type {WebGPUStruct}
|
|
12
|
+
*/
|
|
13
|
+
export const SORT_PASS_SETTINGS_STRUCT = WebGPUStruct.from({
|
|
14
|
+
/**
|
|
15
|
+
* Bit position of the digit this pass sorts on — 0, 8, 16, 24.
|
|
16
|
+
*/
|
|
17
|
+
shift: u32,
|
|
18
|
+
/**
|
|
19
|
+
* Keys in the input. The tail tile is partial and every read is bounds-checked against this.
|
|
20
|
+
*/
|
|
21
|
+
element_count: u32,
|
|
22
|
+
/**
|
|
23
|
+
* Number of tiles, which is the stride between adjacent bins in the bin-major spine.
|
|
24
|
+
*/
|
|
25
|
+
tile_count: u32,
|
|
26
|
+
/**
|
|
27
|
+
* The key's bits, `key_bits` of them set from the bottom: what a digit is selected from. See
|
|
28
|
+
* `sort_extract_key_digit` in {@link chunk_sort_digit}.
|
|
29
|
+
*/
|
|
30
|
+
key_mask: u32,
|
|
31
|
+
}, "SortPassSettings");
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The live size of a sort over a device count, written once by {@link shader_radix_sort_prepare} and
|
|
3
|
+
* read by every histogram and scatter after it. The same two numbers a host-count sort carries in
|
|
4
|
+
* {@link SORT_PASS_SETTINGS_STRUCT}, which the host cannot know here.
|
|
5
|
+
*
|
|
6
|
+
* @type {WebGPUStruct}
|
|
7
|
+
*/
|
|
8
|
+
export const SORT_SIZE_STRUCT: WebGPUStruct;
|
|
9
|
+
import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
|
|
10
|
+
//# sourceMappingURL=SORT_SIZE_STRUCT.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SORT_SIZE_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/gpu_primitive/sort/SORT_SIZE_STRUCT.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,+BAFU,YAAY,CAaP;6BApBc,mCAAmC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { u32 } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
2
|
+
import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The live size of a sort over a device count, written once by {@link shader_radix_sort_prepare} and
|
|
6
|
+
* read by every histogram and scatter after it. The same two numbers a host-count sort carries in
|
|
7
|
+
* {@link SORT_PASS_SETTINGS_STRUCT}, which the host cannot know here.
|
|
8
|
+
*
|
|
9
|
+
* @type {WebGPUStruct}
|
|
10
|
+
*/
|
|
11
|
+
export const SORT_SIZE_STRUCT = WebGPUStruct.from({
|
|
12
|
+
/**
|
|
13
|
+
* Keys being sorted: the device count, at most the sort's `element_max_count`. The tail tile is
|
|
14
|
+
* partial and every read is bounds-checked against this.
|
|
15
|
+
*/
|
|
16
|
+
element_count: u32,
|
|
17
|
+
/**
|
|
18
|
+
* Tiles those keys fill, which is the stride between adjacent bins in the bin-major spine and the
|
|
19
|
+
* number of workgroups the histogram and scatter are dispatched over.
|
|
20
|
+
*/
|
|
21
|
+
tile_count: u32,
|
|
22
|
+
}, "SortSize");
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sort's tile geometry from `defs.js`, as WGSL constants: one declaration for every chunk and
|
|
3
|
+
* shader of the sort that links it, rather than a copy in each.
|
|
4
|
+
*
|
|
5
|
+
* @type {CodeChunk}
|
|
6
|
+
*/
|
|
7
|
+
export const chunk_sort_constants: CodeChunk;
|
|
8
|
+
import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
|
|
9
|
+
//# sourceMappingURL=chunk_sort_constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_sort_constants.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/gpu_primitive/sort/chunk_sort_constants.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,mCAFU,SAAS,CAUhB;0BAjBuB,oCAAoC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
|
|
2
|
+
import { RADIX, RADIX_LOG, SORT_KEYS_PER_THREAD, SORT_TILE_SIZE, SORT_WORKGROUP_SIZE } from "./defs.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The sort's tile geometry from `defs.js`, as WGSL constants: one declaration for every chunk and
|
|
6
|
+
* shader of the sort that links it, rather than a copy in each.
|
|
7
|
+
*
|
|
8
|
+
* @type {CodeChunk}
|
|
9
|
+
*/
|
|
10
|
+
export const chunk_sort_constants = CodeChunk.from(
|
|
11
|
+
//language=WGSL
|
|
12
|
+
`
|
|
13
|
+
const SORT_WORKGROUP_SIZE = ${SORT_WORKGROUP_SIZE}u;
|
|
14
|
+
const SORT_KEYS_PER_THREAD = ${SORT_KEYS_PER_THREAD}u;
|
|
15
|
+
const SORT_TILE_SIZE = ${SORT_TILE_SIZE}u;
|
|
16
|
+
const SORT_RADIX = ${RADIX}u;
|
|
17
|
+
const SORT_RADIX_LOG = ${RADIX_LOG}u;
|
|
18
|
+
`);
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
3
|
-
*
|
|
4
|
-
* arithmetic.
|
|
2
|
+
* The pure index computations the sort's three stages have to agree on, kept out of the shaders so
|
|
3
|
+
* the emulator tier can execute them directly against a CPU statement of the same arithmetic.
|
|
5
4
|
*
|
|
6
5
|
* `sort_extract_digit` is the digit selector: `shift` is 0, 8, 16, 24 across the four passes.
|
|
7
6
|
*
|
|
7
|
+
* `sort_extract_key_digit` is the digit the sort orders by: the same selector over the key's low
|
|
8
|
+
* `key_bits` alone, `key_mask` being those bits set. A key narrower than its last digit pass — 20 bits
|
|
9
|
+
* sorted in three 8-bit passes, say — would otherwise be ordered by whatever sits in the bits above
|
|
10
|
+
* it, which a caller is not required to clear. Every stage that reads a digit or a digit's bit reads
|
|
11
|
+
* it through this, so they all see the same key.
|
|
12
|
+
*
|
|
8
13
|
* `sort_spine_index` is the flattening. The spine holds one 256-bin histogram per tile, laid out
|
|
9
14
|
* **bin-major** — every tile's count for bin 0, then every tile's count for bin 1, and so on — so
|
|
10
15
|
* that a single running scan across it yields, at `(bin, tile)`, the number of keys that precede
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_sort_digit.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/gpu_primitive/sort/chunk_sort_digit.js"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"chunk_sort_digit.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/gpu_primitive/sort/chunk_sort_digit.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,+BAFU,SAAS,CAmBhB;0BAxCuB,oCAAoC"}
|
|
@@ -1,32 +1,41 @@
|
|
|
1
|
-
import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
|
|
2
|
-
import { RADIX, SPINE_HEADER_WORDS } from "./defs.js";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* The
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* `
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* this
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
|
|
2
|
+
import { RADIX, SPINE_HEADER_WORDS } from "./defs.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The pure index computations the sort's three stages have to agree on, kept out of the shaders so
|
|
6
|
+
* the emulator tier can execute them directly against a CPU statement of the same arithmetic.
|
|
7
|
+
*
|
|
8
|
+
* `sort_extract_digit` is the digit selector: `shift` is 0, 8, 16, 24 across the four passes.
|
|
9
|
+
*
|
|
10
|
+
* `sort_extract_key_digit` is the digit the sort orders by: the same selector over the key's low
|
|
11
|
+
* `key_bits` alone, `key_mask` being those bits set. A key narrower than its last digit pass — 20 bits
|
|
12
|
+
* sorted in three 8-bit passes, say — would otherwise be ordered by whatever sits in the bits above
|
|
13
|
+
* it, which a caller is not required to clear. Every stage that reads a digit or a digit's bit reads
|
|
14
|
+
* it through this, so they all see the same key.
|
|
15
|
+
*
|
|
16
|
+
* `sort_spine_index` is the flattening. The spine holds one 256-bin histogram per tile, laid out
|
|
17
|
+
* **bin-major** — every tile's count for bin 0, then every tile's count for bin 1, and so on — so
|
|
18
|
+
* that a single running scan across it yields, at `(bin, tile)`, the number of keys that precede
|
|
19
|
+
* this tile's bin-`bin` run in the final ordering. A tile-major layout would need a second scan
|
|
20
|
+
* over the per-bin totals. {@link SPINE_HEADER_WORDS} steps over the scan's `count` header.
|
|
21
|
+
*
|
|
22
|
+
* @type {CodeChunk}
|
|
23
|
+
*/
|
|
24
|
+
export const chunk_sort_digit = CodeChunk.from(
|
|
25
|
+
//language=WGSL
|
|
26
|
+
`
|
|
27
|
+
const SORT_RADIX_MASK = ${RADIX - 1}u;
|
|
28
|
+
const SORT_SPINE_HEADER_WORDS = ${SPINE_HEADER_WORDS}u;
|
|
29
|
+
|
|
30
|
+
fn sort_extract_digit(key: u32, shift: u32) -> u32 {
|
|
31
|
+
return (key >> shift) & SORT_RADIX_MASK;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
fn sort_extract_key_digit(key: u32, shift: u32, key_mask: u32) -> u32 {
|
|
35
|
+
return sort_extract_digit(key & key_mask, shift);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
fn sort_spine_index(bin: u32, tile: u32, tile_count: u32) -> u32 {
|
|
39
|
+
return SORT_SPINE_HEADER_WORDS + bin * tile_count + tile;
|
|
40
|
+
}
|
|
41
|
+
`);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The keys a histogram counts.
|
|
3
|
+
* @type {ShaderResourceDescriptor}
|
|
4
|
+
*/
|
|
5
|
+
export const SORT_HISTOGRAM_KEYS_RESOURCE: ShaderResourceDescriptor;
|
|
6
|
+
/**
|
|
7
|
+
* `{count: u32, elements: array<vec4u>}` as the scan sees it, flat as the histogram writes it.
|
|
8
|
+
* Every cell is produced by exactly one thread of one workgroup, so no atomics: the only consumer is
|
|
9
|
+
* a later dispatch, and WebGPU orders dispatches against each other.
|
|
10
|
+
* @type {ShaderResourceDescriptor}
|
|
11
|
+
*/
|
|
12
|
+
export const SORT_HISTOGRAM_SPINE_RESOURCE: ShaderResourceDescriptor;
|
|
13
|
+
/**
|
|
14
|
+
* One tile's 256-bin digit histogram, written into the spine bin-major — the body of both
|
|
15
|
+
* {@link shader_radix_sort_histogram} and {@link shader_radix_sort_histogram_indirect}, which differ
|
|
16
|
+
* only in where the tile and the sort's size come from.
|
|
17
|
+
*
|
|
18
|
+
* ```wgsl
|
|
19
|
+
* fn sort_histogram_tile(tile: u32, element_count: u32, tile_count: u32, shift: u32, key_mask: u32, thread_id: u32)
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* Call from workgroup-uniform control flow, every thread of a {@link SORT_WORKGROUP_SIZE}-wide
|
|
23
|
+
* workgroup with its `local_invocation_index`: it holds barriers. `tile` must be below `tile_count`,
|
|
24
|
+
* since the cell it writes for a tile past them belongs to the next bin.
|
|
25
|
+
*
|
|
26
|
+
* @type {CodeChunk}
|
|
27
|
+
*/
|
|
28
|
+
export const chunk_sort_histogram_tile: CodeChunk;
|
|
29
|
+
import { ShaderResourceDescriptor } from "../../shader/resource/ShaderResourceDescriptor.js";
|
|
30
|
+
import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
|
|
31
|
+
//# sourceMappingURL=chunk_sort_histogram_tile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_sort_histogram_tile.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/gpu_primitive/sort/chunk_sort_histogram_tile.js"],"names":[],"mappings":"AAOA;;;GAGG;AACH,2CAFU,wBAAwB,CAEuF;AAEzH;;;;;GAKG;AACH,4CAFU,wBAAwB,CAEwF;AAE1H;;;;;;;;;;;;;;GAcG;AACH,wCAFU,SAAS,CAiChB;yCAlEsC,mDAAmD;0BADlE,oCAAoC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
|
|
2
|
+
import { ShaderResourceDescriptor } from "../../shader/resource/ShaderResourceDescriptor.js";
|
|
3
|
+
import { u32 } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
4
|
+
import { WebGPUArray } from "../../shader/type/WebGPUArray.js";
|
|
5
|
+
import { chunk_sort_constants } from "./chunk_sort_constants.js";
|
|
6
|
+
import { chunk_sort_digit } from "./chunk_sort_digit.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The keys a histogram counts.
|
|
10
|
+
* @type {ShaderResourceDescriptor}
|
|
11
|
+
*/
|
|
12
|
+
export const SORT_HISTOGRAM_KEYS_RESOURCE = ShaderResourceDescriptor.storageBuffer("keys", WebGPUArray.from(u32), false);
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* `{count: u32, elements: array<vec4u>}` as the scan sees it, flat as the histogram writes it.
|
|
16
|
+
* Every cell is produced by exactly one thread of one workgroup, so no atomics: the only consumer is
|
|
17
|
+
* a later dispatch, and WebGPU orders dispatches against each other.
|
|
18
|
+
* @type {ShaderResourceDescriptor}
|
|
19
|
+
*/
|
|
20
|
+
export const SORT_HISTOGRAM_SPINE_RESOURCE = ShaderResourceDescriptor.storageBuffer("spine", WebGPUArray.from(u32), true);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* One tile's 256-bin digit histogram, written into the spine bin-major — the body of both
|
|
24
|
+
* {@link shader_radix_sort_histogram} and {@link shader_radix_sort_histogram_indirect}, which differ
|
|
25
|
+
* only in where the tile and the sort's size come from.
|
|
26
|
+
*
|
|
27
|
+
* ```wgsl
|
|
28
|
+
* fn sort_histogram_tile(tile: u32, element_count: u32, tile_count: u32, shift: u32, key_mask: u32, thread_id: u32)
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* Call from workgroup-uniform control flow, every thread of a {@link SORT_WORKGROUP_SIZE}-wide
|
|
32
|
+
* workgroup with its `local_invocation_index`: it holds barriers. `tile` must be below `tile_count`,
|
|
33
|
+
* since the cell it writes for a tile past them belongs to the next bin.
|
|
34
|
+
*
|
|
35
|
+
* @type {CodeChunk}
|
|
36
|
+
*/
|
|
37
|
+
export const chunk_sort_histogram_tile = CodeChunk.from(
|
|
38
|
+
//language=WGSL
|
|
39
|
+
`
|
|
40
|
+
// One bin per thread — RADIX and the workgroup size are equal, so the clear and the write-out are
|
|
41
|
+
// both a single unstrided step.
|
|
42
|
+
var<workgroup> wg_sort_tile_counts: array<atomic<u32>, SORT_RADIX>;
|
|
43
|
+
|
|
44
|
+
fn sort_histogram_tile(tile: u32, element_count: u32, tile_count: u32, shift: u32, key_mask: u32, thread_id: u32) {
|
|
45
|
+
atomicStore(&wg_sort_tile_counts[thread_id], 0u);
|
|
46
|
+
|
|
47
|
+
workgroupBarrier();
|
|
48
|
+
|
|
49
|
+
// Striped so that neighbouring threads read neighbouring addresses. The tail tile is partial;
|
|
50
|
+
// the keys past the end are not counted, which is what lets the scatter recognise them later
|
|
51
|
+
// by position alone.
|
|
52
|
+
let tile_base = tile * SORT_TILE_SIZE;
|
|
53
|
+
for (var k = 0u; k < SORT_KEYS_PER_THREAD; k += 1u) {
|
|
54
|
+
let source = tile_base + k * SORT_WORKGROUP_SIZE + thread_id;
|
|
55
|
+
|
|
56
|
+
if (source < element_count) {
|
|
57
|
+
atomicAdd(&wg_sort_tile_counts[sort_extract_key_digit(keys[source], shift, key_mask)], 1u);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
workgroupBarrier();
|
|
62
|
+
|
|
63
|
+
spine[sort_spine_index(thread_id, tile, tile_count)] = atomicLoad(&wg_sort_tile_counts[thread_id]);
|
|
64
|
+
}
|
|
65
|
+
`, [
|
|
66
|
+
chunk_sort_constants,
|
|
67
|
+
chunk_sort_digit,
|
|
68
|
+
]);
|
|
69
|
+
|
|
70
|
+
chunk_sort_histogram_tile.requireResource(SORT_HISTOGRAM_KEYS_RESOURCE);
|
|
71
|
+
chunk_sort_histogram_tile.requireResource(SORT_HISTOGRAM_SPINE_RESOURCE);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {ShaderResourceDescriptor}
|
|
3
|
+
*/
|
|
4
|
+
export const SORT_SCATTER_IN_KEYS_RESOURCE: ShaderResourceDescriptor;
|
|
5
|
+
/**
|
|
6
|
+
* @type {ShaderResourceDescriptor}
|
|
7
|
+
*/
|
|
8
|
+
export const SORT_SCATTER_IN_VALUES_RESOURCE: ShaderResourceDescriptor;
|
|
9
|
+
/**
|
|
10
|
+
* @type {ShaderResourceDescriptor}
|
|
11
|
+
*/
|
|
12
|
+
export const SORT_SCATTER_OUT_KEYS_RESOURCE: ShaderResourceDescriptor;
|
|
13
|
+
/**
|
|
14
|
+
* @type {ShaderResourceDescriptor}
|
|
15
|
+
*/
|
|
16
|
+
export const SORT_SCATTER_OUT_VALUES_RESOURCE: ShaderResourceDescriptor;
|
|
17
|
+
/**
|
|
18
|
+
* The scanned spine, read flat past its `{count, elements}` header.
|
|
19
|
+
* @type {ShaderResourceDescriptor}
|
|
20
|
+
*/
|
|
21
|
+
export const SORT_SCATTER_SPINE_RESOURCE: ShaderResourceDescriptor;
|
|
22
|
+
/**
|
|
23
|
+
* One tile's rank-and-scatter — the body of both {@link shader_radix_sort_scatter} and
|
|
24
|
+
* {@link shader_radix_sort_scatter_indirect}, which differ only in where the tile and the sort's size
|
|
25
|
+
* come from.
|
|
26
|
+
*
|
|
27
|
+
* ```wgsl
|
|
28
|
+
* fn sort_scatter_tile(tile: u32, element_count: u32, tile_count: u32, shift: u32, key_mask: u32,
|
|
29
|
+
* thread_id: u32, lane_id: u32, lane_count: u32)
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* The tile is sorted by the current digit in workgroup memory (stability is what an LSD radix sort's
|
|
33
|
+
* correctness rests on, and it is also what lets the tail tile's padding be identified by position),
|
|
34
|
+
* the tile's own histogram is re-derived rather than carried over from the histogram pass — the scan
|
|
35
|
+
* is inclusive-only, and re-counting is cheaper than preserving pre-scan counts — and each key is
|
|
36
|
+
* written to `spine_inclusive[bin] - local_count[bin] - bin_start[bin] + sorted_position`.
|
|
37
|
+
*
|
|
38
|
+
* Call from workgroup-uniform control flow, every thread of a {@link SORT_WORKGROUP_SIZE}-wide
|
|
39
|
+
* workgroup with its `local_invocation_index` and subgroup builtins: it holds barriers and subgroup
|
|
40
|
+
* operations. `tile` must be below `tile_count`.
|
|
41
|
+
*
|
|
42
|
+
* @type {CodeChunk}
|
|
43
|
+
*/
|
|
44
|
+
export const chunk_sort_scatter_tile: CodeChunk;
|
|
45
|
+
import { ShaderResourceDescriptor } from "../../shader/resource/ShaderResourceDescriptor.js";
|
|
46
|
+
import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
|
|
47
|
+
//# sourceMappingURL=chunk_sort_scatter_tile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_sort_scatter_tile.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/gpu_primitive/sort/chunk_sort_scatter_tile.js"],"names":[],"mappings":"AAUA;;GAEG;AACH,4CAFU,wBAAwB,CAE2F;AAE7H;;GAEG;AACH,8CAFU,wBAAwB,CAE+F;AAEjI;;GAEG;AACH,6CAFU,wBAAwB,CAE4F;AAE9H;;GAEG;AACH,+CAFU,wBAAwB,CAEgG;AAElI;;;GAGG;AACH,0CAFU,wBAAwB,CAEuF;AAEzH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,sCAFU,SAAS,CAiJhB;yCAvMsC,mDAAmD;0BADlE,oCAAoC"}
|