@woosh/meep-engine 3.59.0 → 3.60.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 (326) hide show
  1. package/package.json +1 -1
  2. package/src/shade/playground/probe_clipmap/index.html +12 -0
  3. package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
  4. package/src/shade/playground/probe_clipmap/main.js +5 -0
  5. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  6. package/src/shade/renderer/Renderer.js +4 -6
  7. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +63 -1
  8. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
  9. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +228 -16
  10. package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts +27 -4
  11. package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts.map +1 -1
  12. package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.js +526 -23
  13. package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.d.ts +11 -0
  14. package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.d.ts.map +1 -0
  15. package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.js +21 -0
  16. package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.d.ts +65 -0
  17. package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.d.ts.map +1 -0
  18. package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.js +376 -0
  19. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.d.ts +7 -3
  20. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.d.ts.map +1 -1
  21. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.js +70 -6
  22. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.d.ts +20 -0
  23. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.d.ts.map +1 -0
  24. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.js +80 -0
  25. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.d.ts +18 -0
  26. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.d.ts.map +1 -0
  27. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.js +113 -0
  28. package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.d.ts +47 -0
  29. package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.d.ts.map +1 -0
  30. package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.js +80 -0
  31. package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.d.ts +91 -0
  32. package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.d.ts.map +1 -0
  33. package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.js +902 -0
  34. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.d.ts +16 -0
  35. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.d.ts.map +1 -0
  36. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.js +67 -0
  37. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.d.ts +17 -0
  38. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.d.ts.map +1 -0
  39. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.js +145 -0
  40. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.d.ts +12 -0
  41. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.d.ts.map +1 -0
  42. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.js +105 -0
  43. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.d.ts.map +1 -1
  44. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.js +2 -1
  45. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +3 -9
  46. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
  47. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +13 -31
  48. package/src/shade/renderer/global_illumination/probe_clipmap/PROBE_CLIPMAP_PROPOSAL_2026_10_27.md +764 -48
  49. package/src/shade/renderer/global_illumination/probe_clipmap/PROBE_RAYS_VARIABLE_AND_SORTED_SCOPE_2026_10_30.md +410 -0
  50. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts +3 -2
  51. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts.map +1 -1
  52. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.js +4 -3
  53. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +41 -17
  54. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
  55. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +57 -33
  56. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.d.ts +11 -3
  57. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.d.ts.map +1 -1
  58. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.js +13 -4
  59. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +9 -18
  60. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts.map +1 -1
  61. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.js +8 -10
  62. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.d.ts +12 -0
  63. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.d.ts.map +1 -1
  64. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.js +28 -0
  65. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +1 -29
  66. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
  67. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +1 -74
  68. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts +161 -0
  69. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts.map +1 -0
  70. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.js +219 -0
  71. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK_INSTANCE_STRUCT.d.ts +1 -8
  72. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK_INSTANCE_STRUCT.d.ts.map +1 -1
  73. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK_INSTANCE_STRUCT.js +1 -9
  74. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts +40 -12
  75. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts.map +1 -1
  76. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.js +373 -31
  77. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.d.ts +2 -1
  78. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.d.ts.map +1 -1
  79. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.js +2 -1
  80. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.d.ts +15 -8
  81. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.d.ts.map +1 -1
  82. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.js +28 -14
  83. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts +23 -0
  84. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts.map +1 -0
  85. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.js +66 -0
  86. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.d.ts +29 -0
  87. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.d.ts.map +1 -0
  88. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.js +210 -0
  89. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_command.d.ts +29 -0
  90. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_command.d.ts.map +1 -0
  91. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_command.js +86 -0
  92. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts +41 -0
  93. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts.map +1 -0
  94. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.js +439 -0
  95. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.d.ts +23 -0
  96. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.d.ts.map +1 -0
  97. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.js +135 -0
  98. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.d.ts +3 -1
  99. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.d.ts.map +1 -1
  100. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.js +12 -3
  101. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +21 -18
  102. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts.map +1 -1
  103. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js +254 -73
  104. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts +149 -8
  105. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts.map +1 -1
  106. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.js +181 -13
  107. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts +179 -7
  108. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts.map +1 -1
  109. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.js +412 -31
  110. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.js +4 -4
  111. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.d.ts.map +1 -1
  112. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js +4 -3
  113. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts +36 -10
  114. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts.map +1 -1
  115. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.js +218 -29
  116. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts +5 -1
  117. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts.map +1 -1
  118. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.js +24 -14
  119. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts +15 -6
  120. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts.map +1 -1
  121. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.js +21 -22
  122. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.d.ts +36 -0
  123. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.d.ts.map +1 -0
  124. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.js +257 -0
  125. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts +18 -7
  126. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts.map +1 -1
  127. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js +157 -51
  128. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.d.ts +23 -0
  129. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.d.ts.map +1 -0
  130. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.js +110 -0
  131. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts +24 -2
  132. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts.map +1 -1
  133. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js +90 -10
  134. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.d.ts +45 -0
  135. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.d.ts.map +1 -0
  136. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.js +205 -0
  137. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.js +1 -1
  138. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_retire.d.ts +16 -3
  139. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_retire.d.ts.map +1 -1
  140. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_retire.js +55 -10
  141. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.d.ts +19 -4
  142. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.d.ts.map +1 -1
  143. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.js +60 -6
  144. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts +10 -9
  145. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts.map +1 -1
  146. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js +32 -39
  147. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts +21 -14
  148. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts.map +1 -1
  149. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js +100 -30
  150. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.d.ts +6 -2
  151. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.d.ts.map +1 -1
  152. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.js +26 -10
  153. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts +3 -2
  154. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts.map +1 -1
  155. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.js +12 -12
  156. package/src/shade/renderer/gpu_primitive/sort/SORT_DIGIT_SETTINGS_STRUCT.d.ts +10 -0
  157. package/src/shade/renderer/gpu_primitive/sort/SORT_DIGIT_SETTINGS_STRUCT.d.ts.map +1 -0
  158. package/src/shade/renderer/gpu_primitive/sort/SORT_DIGIT_SETTINGS_STRUCT.js +21 -0
  159. package/src/shade/renderer/gpu_primitive/sort/SORT_PASS_SETTINGS_STRUCT.d.ts +5 -2
  160. package/src/shade/renderer/gpu_primitive/sort/SORT_PASS_SETTINGS_STRUCT.d.ts.map +1 -1
  161. package/src/shade/renderer/gpu_primitive/sort/SORT_PASS_SETTINGS_STRUCT.js +31 -23
  162. package/src/shade/renderer/gpu_primitive/sort/SORT_SIZE_STRUCT.d.ts +10 -0
  163. package/src/shade/renderer/gpu_primitive/sort/SORT_SIZE_STRUCT.d.ts.map +1 -0
  164. package/src/shade/renderer/gpu_primitive/sort/SORT_SIZE_STRUCT.js +22 -0
  165. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_constants.d.ts +9 -0
  166. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_constants.d.ts.map +1 -0
  167. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_constants.js +18 -0
  168. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_digit.d.ts +8 -3
  169. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_digit.d.ts.map +1 -1
  170. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_digit.js +41 -32
  171. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_histogram_tile.d.ts +31 -0
  172. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_histogram_tile.d.ts.map +1 -0
  173. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_histogram_tile.js +71 -0
  174. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_scatter_tile.d.ts +47 -0
  175. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_scatter_tile.d.ts.map +1 -0
  176. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_scatter_tile.js +210 -0
  177. package/src/shade/renderer/gpu_primitive/sort/defs.d.ts +5 -4
  178. package/src/shade/renderer/gpu_primitive/sort/defs.d.ts.map +1 -1
  179. package/src/shade/renderer/gpu_primitive/sort/defs.js +5 -4
  180. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts +56 -15
  181. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts.map +1 -1
  182. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.js +410 -61
  183. package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram.d.ts +4 -1
  184. package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram.d.ts.map +1 -1
  185. package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram.js +16 -42
  186. package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram_indirect.d.ts +15 -0
  187. package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram_indirect.d.ts.map +1 -0
  188. package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_histogram_indirect.js +60 -0
  189. package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_prepare.d.ts +25 -0
  190. package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_prepare.d.ts.map +1 -0
  191. package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_prepare.js +89 -0
  192. package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter.d.ts +3 -8
  193. package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter.d.ts.map +1 -1
  194. package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter.js +28 -160
  195. package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter_indirect.d.ts +12 -0
  196. package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter_indirect.d.ts.map +1 -0
  197. package/src/shade/renderer/gpu_primitive/sort/shader_radix_sort_scatter_indirect.js +74 -0
  198. package/src/shade/renderer/gpu_primitive/sort/verify_radix_sort.d.ts +3 -1
  199. package/src/shade/renderer/gpu_primitive/sort/verify_radix_sort.d.ts.map +1 -1
  200. package/src/shade/renderer/gpu_primitive/sort/verify_radix_sort.js +387 -188
  201. package/src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_irradiance_flat.js +1 -1
  202. package/src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_sh.js +1 -1
  203. package/src/shade/renderer/material/resident/GPUResidentMaterialContext.d.ts.map +1 -1
  204. package/src/shade/renderer/material/resident/GPUResidentMaterialContext.js +90 -72
  205. package/src/shade/renderer/material/resident/RESIDENT_MATERIAL_TEXTURE_LAYOUT.d.ts +5 -0
  206. package/src/shade/renderer/material/resident/RESIDENT_MATERIAL_TEXTURE_LAYOUT.d.ts.map +1 -1
  207. package/src/shade/renderer/material/resident/RESIDENT_MATERIAL_TEXTURE_LAYOUT.js +9 -0
  208. package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.d.ts +13 -0
  209. package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.d.ts.map +1 -0
  210. package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.js +14 -0
  211. package/src/shade/renderer/path_tracer/shader/IndirectTextureFilter.d.ts +10 -0
  212. package/src/shade/renderer/path_tracer/shader/IndirectTextureFilter.d.ts.map +1 -0
  213. package/src/shade/renderer/path_tracer/shader/IndirectTextureFilter.js +15 -0
  214. package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_tangent_normal.d.ts +4 -3
  215. package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_tangent_normal.d.ts.map +1 -1
  216. package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_tangent_normal.js +6 -5
  217. package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture.d.ts +17 -2
  218. package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture.d.ts.map +1 -1
  219. package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture.js +25 -57
  220. package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_exact.d.ts +13 -0
  221. package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_exact.d.ts.map +1 -0
  222. package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_exact.js +70 -0
  223. package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_stochastic.d.ts +10 -0
  224. package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_stochastic.d.ts.map +1 -0
  225. package/src/shade/renderer/path_tracer/shader/chunk_indirect_sample_texture_stochastic.js +59 -0
  226. package/src/shade/renderer/path_tracer/shader/chunk_indirect_texture_load.d.ts +12 -0
  227. package/src/shade/renderer/path_tracer/shader/chunk_indirect_texture_load.d.ts.map +1 -0
  228. package/src/shade/renderer/path_tracer/shader/chunk_indirect_texture_load.js +49 -0
  229. package/src/shade/renderer/path_tracer/shader/chunk_ray_hit_to_opacity.d.ts.map +1 -1
  230. package/src/shade/renderer/path_tracer/shader/chunk_ray_hit_to_opacity.js +1 -0
  231. package/src/shade/renderer/path_tracer/shader/chunk_render_trace_path.d.ts.map +1 -1
  232. package/src/shade/renderer/path_tracer/shader/chunk_render_trace_path.js +1 -0
  233. package/src/shade/renderer/path_tracer/shader/chunk_sample_material.d.ts.map +1 -1
  234. package/src/shade/renderer/path_tracer/shader/chunk_sample_material.js +2 -1
  235. package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.d.ts +7 -0
  236. package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.d.ts.map +1 -1
  237. package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.js +15 -6
  238. package/src/shade/renderer/scene/GPUSceneContext.d.ts +7 -1
  239. package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
  240. package/src/shade/renderer/scene/GPUSceneContext.js +26 -1
  241. package/src/shade/renderer/shader/chunk/bvh/chunk_bvh_query_aabb_cooperative.d.ts +7 -7
  242. package/src/shade/renderer/shader/chunk/bvh/chunk_bvh_query_aabb_cooperative.d.ts.map +1 -1
  243. package/src/shade/renderer/shader/chunk/bvh/chunk_bvh_query_aabb_cooperative.js +262 -294
  244. package/src/shade/renderer/shader/chunk/filter/MULTISCALE_MEAN_STRUCT.d.ts +9 -0
  245. package/src/shade/renderer/shader/chunk/filter/MULTISCALE_MEAN_STRUCT.d.ts.map +1 -0
  246. package/src/shade/renderer/shader/chunk/filter/MULTISCALE_MEAN_STRUCT.js +21 -0
  247. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts +43 -0
  248. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts.map +1 -0
  249. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.js +87 -0
  250. package/src/shade/renderer/shader/chunk/noise/r/chunk_r2_canonical.d.ts +7 -1
  251. package/src/shade/renderer/shader/chunk/noise/r/chunk_r2_canonical.d.ts.map +1 -1
  252. package/src/shade/renderer/shader/chunk/noise/r/chunk_r2_canonical.js +1 -1
  253. package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_reserve_workgroup.d.ts +21 -0
  254. package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_reserve_workgroup.d.ts.map +1 -0
  255. package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_reserve_workgroup.js +42 -0
  256. package/src/shade/renderer/wind/GPUSceneWind.d.ts +1 -1
  257. package/src/shade/wgsl/emulator/CPUBitmapData.d.ts +19 -0
  258. package/src/shade/wgsl/emulator/CPUBitmapData.d.ts.map +1 -1
  259. package/src/shade/wgsl/emulator/CPUBitmapData.js +27 -0
  260. package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
  261. package/src/shade/wgsl/emulator/WGSLLanguageCore.js +65 -19
  262. package/src/view/elements/progress/segmented/GhostTrail.d.ts +116 -0
  263. package/src/view/elements/progress/segmented/GhostTrail.d.ts.map +1 -0
  264. package/src/view/elements/progress/segmented/GhostTrail.js +280 -0
  265. package/src/view/elements/progress/segmented/RESOURCE_BAR_SEGMENTS.d.ts +3 -1
  266. package/src/view/elements/progress/segmented/RESOURCE_BAR_SEGMENTS.d.ts.map +1 -1
  267. package/src/view/elements/progress/segmented/RESOURCE_BAR_SEGMENTS.js +3 -1
  268. package/src/view/elements/progress/segmented/SEGMENT_TIERS_DEFAULT.d.ts +11 -0
  269. package/src/view/elements/progress/segmented/SEGMENT_TIERS_DEFAULT.d.ts.map +1 -0
  270. package/src/view/elements/progress/segmented/SEGMENT_TIERS_DEFAULT.js +15 -0
  271. package/src/view/elements/progress/segmented/SegmentDefinition.d.ts +3 -0
  272. package/src/view/elements/progress/segmented/SegmentDefinition.d.ts.map +1 -1
  273. package/src/view/elements/progress/segmented/SegmentDefinition.js +3 -0
  274. package/src/view/elements/progress/segmented/SegmentTier.d.ts +38 -0
  275. package/src/view/elements/progress/segmented/SegmentTier.d.ts.map +1 -0
  276. package/src/view/elements/progress/segmented/SegmentTier.js +50 -0
  277. package/src/view/elements/progress/segmented/SegmentedResourceBarView.d.ts +163 -10
  278. package/src/view/elements/progress/segmented/SegmentedResourceBarView.d.ts.map +1 -1
  279. package/src/view/elements/progress/segmented/SegmentedResourceBarView.js +442 -101
  280. package/src/view/elements/progress/segmented/playground/index.html +78 -0
  281. package/src/view/elements/progress/segmented/playground/main.d.ts +2 -0
  282. package/src/view/elements/progress/segmented/playground/main.d.ts.map +1 -0
  283. package/src/view/elements/progress/segmented/playground/main.js +173 -0
  284. package/src/view/elements/progress/segmented/segment_cell_layout.d.ts +48 -0
  285. package/src/view/elements/progress/segmented/segment_cell_layout.d.ts.map +1 -0
  286. package/src/view/elements/progress/segmented/segment_cell_layout.js +75 -0
  287. package/src/view/elements/progress/segmented/segment_notch_place.d.ts +18 -0
  288. package/src/view/elements/progress/segmented/segment_notch_place.d.ts.map +1 -0
  289. package/src/view/elements/progress/segmented/segment_notch_place.js +28 -0
  290. package/src/view/elements/progress/segmented/segment_tick_positions.d.ts +32 -0
  291. package/src/view/elements/progress/segmented/segment_tick_positions.d.ts.map +1 -0
  292. package/src/view/elements/progress/segmented/segment_tick_positions.js +103 -0
  293. package/src/view/elements/progress/segmented/segmented-resource-bar.css +142 -0
  294. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_provider.d.ts +0 -35
  295. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_provider.d.ts.map +0 -1
  296. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_provider.js +0 -238
  297. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGEO_BRICK.d.ts +0 -99
  298. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGEO_BRICK.d.ts.map +0 -1
  299. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGEO_BRICK.js +0 -139
  300. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGeoBrickProvider.d.ts +0 -65
  301. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGeoBrickProvider.d.ts.map +0 -1
  302. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGeoBrickProvider.js +0 -393
  303. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_box.d.ts +0 -17
  304. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_box.d.ts.map +0 -1
  305. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_box.js +0 -36
  306. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_pair.d.ts +0 -29
  307. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_pair.d.ts.map +0 -1
  308. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_pair.js +0 -108
  309. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_texel.d.ts +0 -31
  310. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_texel.d.ts.map +0 -1
  311. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_texel.js +0 -113
  312. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_triangle.d.ts +0 -36
  313. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_triangle.d.ts.map +0 -1
  314. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_triangle.js +0 -85
  315. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_distance.d.ts +0 -23
  316. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_distance.d.ts.map +0 -1
  317. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_distance.js +0 -273
  318. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_gather.d.ts +0 -13
  319. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_gather.d.ts.map +0 -1
  320. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_gather.js +0 -151
  321. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_traverse.d.ts +0 -13
  322. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_traverse.d.ts.map +0 -1
  323. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_traverse.js +0 -133
  324. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_wait.d.ts +0 -22
  325. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_wait.d.ts.map +0 -1
  326. 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 { chunk_probe_clipmap, PROBE_DISPATCH_RESOURCE, PROBE_TRACE_READ_RESOURCE } from "./chunk_probe_clipmap.js";
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' projection;
35
- * - a thread a ray of theirs, R a probe, at `PROBE_DISPATCH_RAYS`: trace and shade;
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
- let rays = folded_dispatch((traced * settings.rays_per_probe + PROBE_THREAD_WORKGROUP_SIZE - 1u) / PROBE_THREAD_WORKGROUP_SIZE);
58
-
59
- probe_dispatch[PROBE_DISPATCH_RAYS] = rays.x;
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, and
20
- * is told that frame's U and R.
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":"AAoBA;;GAEG;AACH,uCAFU,YAAY,CAYM;AAe5B;;;;;;;;;;;;;;;;;;GAkBG;AACH,6CAFU,aAAa,CA4CpB;6BAvG0B,sCAAsC;8BAHrC,kCAAkC"}
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"}
@@ -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, and
64
- * is told that frame's U and R.
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
- if (ray < min(probe_trace.count, settings.trace_capacity) * rays) {
87
- let record = probe_rays[ray];
88
- let slot = probe_trace.elements[ray / rays];
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].screen != 0u;
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[ray / rays].xyz + record.t * direction;
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 the two agree on which keys
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;;;;;GAKG;AACH,wCAFU,YAAY,CAeC;6BArBM,mCAAmC"}
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 the two agree on which keys
6
- * exist and where their counts live in the spine.
7
- *
8
- * @type {WebGPUStruct}
9
- */
10
- export const SORT_PASS_SETTINGS_STRUCT = WebGPUStruct.from({
11
- /**
12
- * Bit position of the digit this pass sorts on — 0, 8, 16, 24.
13
- */
14
- shift: u32,
15
- /**
16
- * Keys in the input. The tail tile is partial and every read is bounds-checked against this.
17
- */
18
- element_count: u32,
19
- /**
20
- * Number of tiles, which is the stride between adjacent bins in the bin-major spine.
21
- */
22
- tile_count: u32,
23
- }, "SortPassSettings");
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 two pure index computations the sort's three stages have to agree on, kept out of the
3
- * shaders so the emulator tier can execute them directly against a CPU statement of the same
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;;;;;;;;;;;;;;GAcG;AACH,+BAFU,SAAS,CAehB;0BA/BuB,oCAAoC"}
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 two pure index computations the sort's three stages have to agree on, kept out of the
6
- * shaders so the emulator tier can execute them directly against a CPU statement of the same
7
- * arithmetic.
8
- *
9
- * `sort_extract_digit` is the digit selector: `shift` is 0, 8, 16, 24 across the four passes.
10
- *
11
- * `sort_spine_index` is the flattening. The spine holds one 256-bin histogram per tile, laid out
12
- * **bin-major** — every tile's count for bin 0, then every tile's count for bin 1, and so on — so
13
- * that a single running scan across it yields, at `(bin, tile)`, the number of keys that precede
14
- * this tile's bin-`bin` run in the final ordering. A tile-major layout would need a second scan
15
- * over the per-bin totals. {@link SPINE_HEADER_WORDS} steps over the scan's `count` header.
16
- *
17
- * @type {CodeChunk}
18
- */
19
- export const chunk_sort_digit = CodeChunk.from(
20
- //language=WGSL
21
- `
22
- const SORT_RADIX_MASK = ${RADIX - 1}u;
23
- const SORT_SPINE_HEADER_WORDS = ${SPINE_HEADER_WORDS}u;
24
-
25
- fn sort_extract_digit(key: u32, shift: u32) -> u32 {
26
- return (key >> shift) & SORT_RADIX_MASK;
27
- }
28
-
29
- fn sort_spine_index(bin: u32, tile: u32, tile_count: u32) -> u32 {
30
- return SORT_SPINE_HEADER_WORDS + bin * tile_count + tile;
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"}