@woosh/meep-engine 3.79.0 → 3.80.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 (309) hide show
  1. package/CHANGELOG.md +62 -3
  2. package/README.md +1 -1
  3. package/package.json +1 -1
  4. package/src/format/image/webp/vp8/VP8BoolDecoder.d.ts +45 -0
  5. package/src/format/image/webp/vp8/VP8BoolDecoder.d.ts.map +1 -0
  6. package/src/format/image/webp/vp8/VP8BoolDecoder.js +137 -0
  7. package/src/format/image/webp/vp8/vp8_decode.d.ts +21 -0
  8. package/src/format/image/webp/vp8/vp8_decode.d.ts.map +1 -0
  9. package/src/format/image/webp/vp8/vp8_decode.js +756 -0
  10. package/src/format/image/webp/vp8/vp8_loop_filter.d.ts +31 -0
  11. package/src/format/image/webp/vp8/vp8_loop_filter.d.ts.map +1 -0
  12. package/src/format/image/webp/vp8/vp8_loop_filter.js +189 -0
  13. package/src/format/image/webp/vp8/vp8_predict.d.ts +48 -0
  14. package/src/format/image/webp/vp8/vp8_predict.d.ts.map +1 -0
  15. package/src/format/image/webp/vp8/vp8_predict.js +290 -0
  16. package/src/format/image/webp/vp8/vp8_tables.d.ts +34 -0
  17. package/src/format/image/webp/vp8/vp8_tables.d.ts.map +1 -0
  18. package/src/format/image/webp/vp8/vp8_tables.js +350 -0
  19. package/src/format/image/webp/vp8/vp8_transform.d.ts +22 -0
  20. package/src/format/image/webp/vp8/vp8_transform.d.ts.map +1 -0
  21. package/src/format/image/webp/vp8/vp8_transform.js +114 -0
  22. package/src/format/image/webp/vp8/vp8_yuv_to_rgba.d.ts +23 -0
  23. package/src/format/image/webp/vp8/vp8_yuv_to_rgba.d.ts.map +1 -0
  24. package/src/format/image/webp/vp8/vp8_yuv_to_rgba.js +133 -0
  25. package/src/format/image/webp/vp8l/VP8LBitReader.d.ts +47 -0
  26. package/src/format/image/webp/vp8l/VP8LBitReader.d.ts.map +1 -0
  27. package/src/format/image/webp/vp8l/VP8LBitReader.js +84 -0
  28. package/src/format/image/webp/vp8l/VP8LPrefixCode.d.ts +27 -0
  29. package/src/format/image/webp/vp8l/VP8LPrefixCode.d.ts.map +1 -0
  30. package/src/format/image/webp/vp8l/VP8LPrefixCode.js +184 -0
  31. package/src/format/image/webp/vp8l/vp8l_decode.d.ts +28 -0
  32. package/src/format/image/webp/vp8l/vp8l_decode.d.ts.map +1 -0
  33. package/src/format/image/webp/vp8l/vp8l_decode.js +261 -0
  34. package/src/format/image/webp/vp8l/vp8l_distance.d.ts +22 -0
  35. package/src/format/image/webp/vp8l/vp8l_distance.d.ts.map +1 -0
  36. package/src/format/image/webp/vp8l/vp8l_distance.js +62 -0
  37. package/src/format/image/webp/vp8l/vp8l_inverse_transforms.d.ts +50 -0
  38. package/src/format/image/webp/vp8l/vp8l_inverse_transforms.d.ts.map +1 -0
  39. package/src/format/image/webp/vp8l/vp8l_inverse_transforms.js +267 -0
  40. package/src/format/image/webp/vp8l/vp8l_read_prefix_code.d.ts +14 -0
  41. package/src/format/image/webp/vp8l/vp8l_read_prefix_code.d.ts.map +1 -0
  42. package/src/format/image/webp/vp8l/vp8l_read_prefix_code.js +99 -0
  43. package/src/format/image/webp/webp_decode.d.ts +23 -0
  44. package/src/format/image/webp/webp_decode.d.ts.map +1 -0
  45. package/src/format/image/webp/webp_decode.js +179 -0
  46. package/src/format/image/webp/webp_decode_alpha.d.ts +18 -0
  47. package/src/format/image/webp/webp_decode_alpha.d.ts.map +1 -0
  48. package/src/format/image/webp/webp_decode_alpha.js +84 -0
  49. package/src/format/texture/{basis → astc}/astc_block.d.ts +41 -0
  50. package/src/format/texture/astc/astc_block.d.ts.map +1 -0
  51. package/src/format/texture/{basis → astc}/astc_block.js +284 -164
  52. package/src/format/texture/astc/astc_decode_block.d.ts +68 -0
  53. package/src/format/texture/astc/astc_decode_block.d.ts.map +1 -0
  54. package/src/format/texture/astc/astc_decode_block.js +1119 -0
  55. package/src/format/texture/astc/astc_encode_block_4x4.d.ts +32 -0
  56. package/src/format/texture/astc/astc_encode_block_4x4.d.ts.map +1 -0
  57. package/src/format/texture/astc/astc_encode_block_4x4.js +181 -0
  58. package/src/format/texture/astc/astc_encode_block_4x4_rgba.d.ts +32 -0
  59. package/src/format/texture/astc/astc_encode_block_4x4_rgba.d.ts.map +1 -0
  60. package/src/format/texture/astc/astc_encode_block_4x4_rgba.js +337 -0
  61. package/src/format/texture/astc/astc_integer_sequence.d.ts.map +1 -0
  62. package/src/format/texture/{basis → astc}/astc_integer_sequence.js +251 -251
  63. package/src/format/texture/astc/astc_partition.d.ts.map +1 -0
  64. package/src/format/texture/{basis → astc}/astc_partition.js +199 -199
  65. package/src/format/texture/basis/transcode/etc1s_to_astc.js +329 -329
  66. package/src/format/texture/basis/transcode/etc1s_to_etc2.d.ts.map +1 -1
  67. package/src/format/texture/basis/transcode/etc1s_to_etc2.js +305 -332
  68. package/src/format/texture/basis/transcode/fit_endpoints.d.ts.map +1 -1
  69. package/src/format/texture/basis/transcode/fit_endpoints.js +14 -27
  70. package/src/format/texture/basis/uastc/uastc_bc7_tables.d.ts +66 -0
  71. package/src/format/texture/basis/uastc/uastc_bc7_tables.d.ts.map +1 -0
  72. package/src/format/texture/basis/uastc/uastc_bc7_tables.js +148 -0
  73. package/src/format/texture/basis/uastc/uastc_decode_block.js +463 -463
  74. package/src/format/texture/basis/uastc/uastc_to_astc.js +421 -421
  75. package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts +1 -6
  76. package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts.map +1 -1
  77. package/src/format/texture/basis/uastc/uastc_to_bc5.js +48 -115
  78. package/src/format/texture/basis/uastc/uastc_to_bc7.d.ts.map +1 -1
  79. package/src/format/texture/basis/uastc/uastc_to_bc7.js +604 -602
  80. package/src/format/texture/bc/bc1_decode_block.d.ts +19 -0
  81. package/src/format/texture/bc/bc1_decode_block.d.ts.map +1 -0
  82. package/src/format/texture/bc/bc1_decode_block.js +22 -0
  83. package/src/format/texture/bc/bc1_decode_colors.d.ts +27 -0
  84. package/src/format/texture/bc/bc1_decode_colors.d.ts.map +1 -0
  85. package/src/format/texture/bc/bc1_decode_colors.js +100 -0
  86. package/src/format/texture/bc/bc2_decode_block.d.ts +18 -0
  87. package/src/format/texture/bc/bc2_decode_block.d.ts.map +1 -0
  88. package/src/format/texture/bc/bc2_decode_block.js +28 -0
  89. package/src/format/texture/bc/bc3_decode_block.d.ts +18 -0
  90. package/src/format/texture/bc/bc3_decode_block.d.ts.map +1 -0
  91. package/src/format/texture/bc/bc3_decode_block.js +23 -0
  92. package/src/format/texture/bc/bc4_decode_channel.d.ts +56 -0
  93. package/src/format/texture/bc/bc4_decode_channel.d.ts.map +1 -0
  94. package/src/format/texture/bc/bc4_decode_channel.js +138 -0
  95. package/src/format/texture/bc/bc4_encode_block.d.ts +43 -0
  96. package/src/format/texture/bc/bc4_encode_block.d.ts.map +1 -0
  97. package/src/format/texture/bc/bc4_encode_block.js +324 -0
  98. package/src/format/texture/bc/bc4_snorm_decode_block.d.ts +18 -0
  99. package/src/format/texture/bc/bc4_snorm_decode_block.d.ts.map +1 -0
  100. package/src/format/texture/bc/bc4_snorm_decode_block.js +27 -0
  101. package/src/format/texture/bc/bc4_unorm_decode_block.d.ts +17 -0
  102. package/src/format/texture/bc/bc4_unorm_decode_block.d.ts.map +1 -0
  103. package/src/format/texture/bc/bc4_unorm_decode_block.js +26 -0
  104. package/src/format/texture/bc/bc5_encode_block.d.ts +25 -0
  105. package/src/format/texture/bc/bc5_encode_block.d.ts.map +1 -0
  106. package/src/format/texture/bc/bc5_encode_block.js +34 -0
  107. package/src/format/texture/bc/bc5_snorm_decode_block.d.ts +18 -0
  108. package/src/format/texture/bc/bc5_snorm_decode_block.d.ts.map +1 -0
  109. package/src/format/texture/bc/bc5_snorm_decode_block.js +27 -0
  110. package/src/format/texture/bc/bc5_unorm_decode_block.d.ts +17 -0
  111. package/src/format/texture/bc/bc5_unorm_decode_block.d.ts.map +1 -0
  112. package/src/format/texture/bc/bc5_unorm_decode_block.js +26 -0
  113. package/src/format/texture/bc/bc6h_decode_texels.d.ts +30 -0
  114. package/src/format/texture/bc/bc6h_decode_texels.d.ts.map +1 -0
  115. package/src/format/texture/bc/bc6h_decode_texels.js +430 -0
  116. package/src/format/texture/bc/bc6h_sfloat_decode_block.d.ts +20 -0
  117. package/src/format/texture/bc/bc6h_sfloat_decode_block.d.ts.map +1 -0
  118. package/src/format/texture/bc/bc6h_sfloat_decode_block.js +23 -0
  119. package/src/format/texture/bc/bc6h_ufloat_decode_block.d.ts +18 -0
  120. package/src/format/texture/bc/bc6h_ufloat_decode_block.d.ts.map +1 -0
  121. package/src/format/texture/bc/bc6h_ufloat_decode_block.js +21 -0
  122. package/src/format/texture/bc/bc7_decode_block.d.ts +30 -0
  123. package/src/format/texture/bc/bc7_decode_block.d.ts.map +1 -0
  124. package/src/format/texture/bc/bc7_decode_block.js +232 -0
  125. package/src/format/texture/bc/bc7_encode_block.d.ts +39 -0
  126. package/src/format/texture/bc/bc7_encode_block.d.ts.map +1 -0
  127. package/src/format/texture/bc/bc7_encode_block.js +423 -0
  128. package/src/format/texture/bc/bc7_tables.d.ts +126 -0
  129. package/src/format/texture/bc/bc7_tables.d.ts.map +1 -0
  130. package/src/format/texture/{basis/uastc → bc}/bc7_tables.js +225 -276
  131. package/src/format/texture/bc/bc7_write_block.d.ts +65 -0
  132. package/src/format/texture/bc/bc7_write_block.d.ts.map +1 -0
  133. package/src/format/texture/{basis/uastc → bc}/bc7_write_block.js +185 -227
  134. package/src/format/texture/etc/eac_decode_channel.d.ts +50 -0
  135. package/src/format/texture/etc/eac_decode_channel.d.ts.map +1 -0
  136. package/src/format/texture/etc/eac_decode_channel.js +142 -0
  137. package/src/format/texture/etc/eac_modifiers.d.ts +15 -0
  138. package/src/format/texture/etc/eac_modifiers.d.ts.map +1 -0
  139. package/src/format/texture/etc/eac_modifiers.js +31 -0
  140. package/src/format/texture/etc/eac_r11_snorm_decode_block.d.ts +21 -0
  141. package/src/format/texture/etc/eac_r11_snorm_decode_block.d.ts.map +1 -0
  142. package/src/format/texture/etc/eac_r11_snorm_decode_block.js +30 -0
  143. package/src/format/texture/etc/eac_r11_unorm_decode_block.d.ts +20 -0
  144. package/src/format/texture/etc/eac_r11_unorm_decode_block.d.ts.map +1 -0
  145. package/src/format/texture/etc/eac_r11_unorm_decode_block.js +29 -0
  146. package/src/format/texture/etc/eac_rg11_snorm_decode_block.d.ts +19 -0
  147. package/src/format/texture/etc/eac_rg11_snorm_decode_block.d.ts.map +1 -0
  148. package/src/format/texture/etc/eac_rg11_snorm_decode_block.js +28 -0
  149. package/src/format/texture/etc/eac_rg11_unorm_decode_block.d.ts +19 -0
  150. package/src/format/texture/etc/eac_rg11_unorm_decode_block.d.ts.map +1 -0
  151. package/src/format/texture/etc/eac_rg11_unorm_decode_block.js +28 -0
  152. package/src/format/texture/etc/etc2_decode_color.d.ts +25 -0
  153. package/src/format/texture/etc/etc2_decode_color.d.ts.map +1 -0
  154. package/src/format/texture/etc/etc2_decode_color.js +370 -0
  155. package/src/format/texture/etc/etc2_rgb8_decode_block.d.ts +18 -0
  156. package/src/format/texture/etc/etc2_rgb8_decode_block.d.ts.map +1 -0
  157. package/src/format/texture/etc/etc2_rgb8_decode_block.js +21 -0
  158. package/src/format/texture/etc/etc2_rgb8a1_decode_block.d.ts +21 -0
  159. package/src/format/texture/etc/etc2_rgb8a1_decode_block.d.ts.map +1 -0
  160. package/src/format/texture/etc/etc2_rgb8a1_decode_block.js +24 -0
  161. package/src/format/texture/etc/etc2_rgba8_decode_block.d.ts +18 -0
  162. package/src/format/texture/etc/etc2_rgba8_decode_block.d.ts.map +1 -0
  163. package/src/format/texture/etc/etc2_rgba8_decode_block.js +24 -0
  164. package/src/format/texture/fit/fit_line.d.ts +23 -0
  165. package/src/format/texture/fit/fit_line.d.ts.map +1 -0
  166. package/src/format/texture/fit/fit_line.js +123 -0
  167. package/src/format/texture/fit/fit_line_refine.d.ts +21 -0
  168. package/src/format/texture/fit/fit_line_refine.d.ts.map +1 -0
  169. package/src/format/texture/fit/fit_line_refine.js +69 -0
  170. package/src/format/texture/fit/fit_line_solve.d.ts +23 -0
  171. package/src/format/texture/fit/fit_line_solve.d.ts.map +1 -0
  172. package/src/format/texture/fit/fit_line_solve.js +71 -0
  173. package/src/format/texture/texel_decode_image.d.ts +44 -0
  174. package/src/format/texture/texel_decode_image.d.ts.map +1 -0
  175. package/src/format/texture/texel_decode_image.js +251 -0
  176. package/src/format/texture/texel_encode_image.d.ts +77 -0
  177. package/src/format/texture/texel_encode_image.d.ts.map +1 -0
  178. package/src/format/texture/texel_encode_image.js +187 -0
  179. package/src/shade/renderer/ShadeIndirectLightingMode.js +2 -0
  180. package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
  181. package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
  182. package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts +1 -0
  183. package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts.map +1 -1
  184. package/src/shade/renderer/loader/mtf/mtf_encode_texture.js +102 -28
  185. package/src/shade/renderer/loader/mtf/mtf_replace_textures.d.ts +19 -0
  186. package/src/shade/renderer/loader/mtf/mtf_replace_textures.d.ts.map +1 -0
  187. package/src/shade/renderer/loader/mtf/mtf_replace_textures.js +60 -0
  188. package/src/shade/renderer/loader/mtf/mtf_write.d.ts.map +1 -1
  189. package/src/shade/renderer/loader/mtf/mtf_write.js +7 -31
  190. package/src/shade/renderer/loader/mtf/mtf_write_collection.d.ts +23 -0
  191. package/src/shade/renderer/loader/mtf/mtf_write_collection.d.ts.map +1 -0
  192. package/src/shade/renderer/loader/mtf/mtf_write_collection.js +36 -0
  193. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.d.ts +13 -0
  194. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.d.ts.map +1 -0
  195. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.js +39 -0
  196. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts +3 -2
  197. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -1
  198. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +6 -21
  199. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.d.ts +42 -0
  200. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.d.ts.map +1 -0
  201. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.js +612 -0
  202. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +5 -4
  203. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -1
  204. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +8 -25
  205. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -1
  206. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +3 -19
  207. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts +14 -4
  208. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts.map +1 -1
  209. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.js +65 -54
  210. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +2 -2
  211. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -1
  212. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +5 -22
  213. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.js +1 -1
  214. package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.d.ts +27 -0
  215. package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.d.ts.map +1 -0
  216. package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.js +147 -0
  217. package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts +3 -4
  218. package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts.map +1 -1
  219. package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.js +6 -13
  220. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.d.ts +13 -0
  221. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.d.ts.map +1 -0
  222. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.js +66 -0
  223. package/src/shade/renderer/texture/encode/texture_encode.d.ts +28 -1
  224. package/src/shade/renderer/texture/encode/texture_encode.d.ts.map +1 -1
  225. package/src/shade/renderer/texture/encode/texture_encode.js +202 -168
  226. package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts +13 -1
  227. package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts.map +1 -1
  228. package/src/shade/renderer/texture/encode/texture_encode_shader.js +146 -108
  229. package/src/shade/renderer/texture/format/texture_formats_to_build.d.ts +20 -0
  230. package/src/shade/renderer/texture/format/texture_formats_to_build.d.ts.map +1 -0
  231. package/src/shade/renderer/texture/format/texture_formats_to_build.js +98 -0
  232. package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.d.ts.map +1 -1
  233. package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.js +4 -23
  234. package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.d.ts +53 -0
  235. package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.d.ts.map +1 -0
  236. package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.js +76 -0
  237. package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.d.ts +40 -0
  238. package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.d.ts.map +1 -0
  239. package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.js +43 -0
  240. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.d.ts +17 -0
  241. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.d.ts.map +1 -0
  242. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.js +29 -0
  243. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.d.ts +21 -0
  244. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.d.ts.map +1 -0
  245. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.js +91 -0
  246. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.d.ts +32 -0
  247. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.d.ts.map +1 -0
  248. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.js +216 -0
  249. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.d.ts +30 -0
  250. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.d.ts.map +1 -0
  251. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.js +134 -0
  252. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.d.ts +16 -0
  253. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.d.ts.map +1 -0
  254. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.js +33 -0
  255. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.d.ts +18 -0
  256. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.d.ts.map +1 -0
  257. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.js +71 -0
  258. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.d.ts +20 -0
  259. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.d.ts.map +1 -0
  260. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.js +57 -0
  261. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.d.ts +18 -0
  262. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.d.ts.map +1 -0
  263. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.js +111 -0
  264. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.d.ts +16 -0
  265. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.d.ts.map +1 -0
  266. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.js +33 -0
  267. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.d.ts +18 -0
  268. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.d.ts.map +1 -0
  269. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.js +128 -0
  270. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.d.ts +21 -0
  271. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.d.ts.map +1 -0
  272. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.js +169 -0
  273. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.d.ts +21 -0
  274. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.d.ts.map +1 -0
  275. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.js +119 -0
  276. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.d.ts +16 -0
  277. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.d.ts.map +1 -0
  278. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.js +19 -0
  279. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.d.ts +24 -0
  280. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.d.ts.map +1 -0
  281. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.js +41 -0
  282. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.d.ts +24 -0
  283. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.d.ts.map +1 -0
  284. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.js +140 -0
  285. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.d.ts +21 -0
  286. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.d.ts.map +1 -0
  287. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.js +35 -0
  288. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.d.ts +19 -0
  289. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.d.ts.map +1 -0
  290. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.js +27 -0
  291. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_catmull_rom.js +4 -4
  292. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.d.ts +13 -0
  293. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.d.ts.map +1 -1
  294. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.js +54 -4
  295. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mitchell.js +4 -4
  296. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mks.d.ts.map +1 -1
  297. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mks.js +9 -13
  298. package/src/shade/renderer/texture/texture_block_encodings.d.ts +33 -0
  299. package/src/shade/renderer/texture/texture_block_encodings.d.ts.map +1 -0
  300. package/src/shade/renderer/texture/texture_block_encodings.js +89 -0
  301. package/src/format/texture/basis/astc_block.d.ts.map +0 -1
  302. package/src/format/texture/basis/astc_integer_sequence.d.ts.map +0 -1
  303. package/src/format/texture/basis/astc_partition.d.ts.map +0 -1
  304. package/src/format/texture/basis/uastc/bc7_tables.d.ts +0 -111
  305. package/src/format/texture/basis/uastc/bc7_tables.d.ts.map +0 -1
  306. package/src/format/texture/basis/uastc/bc7_write_block.d.ts +0 -124
  307. package/src/format/texture/basis/uastc/bc7_write_block.d.ts.map +0 -1
  308. /package/src/format/texture/{basis → astc}/astc_integer_sequence.d.ts +0 -0
  309. /package/src/format/texture/{basis → astc}/astc_partition.d.ts +0 -0
@@ -1,108 +1,146 @@
1
- import { gpu_texture_format_info } from "../../../descriptor/texture/format/gpu_texture_format_info.js";
2
- import { TextureFormat } from "../../../descriptor/texture/format/TextureFormat.js";
3
- import { shader_texture_encode_astc_4x4 } from "./shader_texture_encode_astc_4x4.js";
4
- import { shader_texture_encode_bc1 } from "./shader_texture_encode_bc1.js";
5
- import { shader_texture_encode_bc4 } from "./shader_texture_encode_bc4.js";
6
- import { shader_texture_encode_bc4_snorm } from "./shader_texture_encode_bc4_snorm.js";
7
- import { shader_texture_encode_bc5 } from "./shader_texture_encode_bc5.js";
8
- import { shader_texture_encode_bc5_snorm } from "./shader_texture_encode_bc5_snorm.js";
9
- import { shader_texture_encode_bc6h } from "./shader_texture_encode_bc6h.js";
10
- import { shader_texture_encode_bc7 } from "./shader_texture_encode_bc7.js";
11
-
12
- /**
13
- * Every format the block encoder is meant to write, implemented or not.
14
- *
15
- * The list the refusal below reads, so that a target that is planned and a name that was never a
16
- * target get different answers: one says "not yet", the other "not at all".
17
- *
18
- * @readonly
19
- * @type {GPUTextureFormat[]}
20
- */
21
- export const TEXTURE_ENCODE_TARGETS = [
22
- TextureFormat.BC1_RGBA_UNORM,
23
- TextureFormat.BC1_RGBA_UNORM_SRGB,
24
- TextureFormat.BC4_R_UNORM,
25
- TextureFormat.BC4_R_SNORM,
26
- TextureFormat.BC5_RG_UNORM,
27
- TextureFormat.BC5_RG_SNORM,
28
- TextureFormat.BC6H_RGB_UFLOAT,
29
- TextureFormat.BC7_RGBA_UNORM,
30
- TextureFormat.BC7_RGBA_UNORM_SRGB,
31
- TextureFormat.ASTC_4X4_UNORM,
32
- TextureFormat.ASTC_4X4_UNORM_SRGB,
33
- TextureFormat.ASTC_6X6_UNORM,
34
- TextureFormat.ASTC_6X6_UNORM_SRGB,
35
- TextureFormat.ASTC_8X8_UNORM,
36
- TextureFormat.ASTC_8X8_UNORM_SRGB,
37
- ];
38
-
39
- /**
40
- * The encoder for each implemented target.
41
- *
42
- * **An `-srgb` format and its linear twin are one encoder**, listed twice rather than resolved by
43
- * stripping the suffix: the two are the same encoded bytes and differ only in how the sampler
44
- * decodes them, so the encoder does identical work and the caller's format is the tag the texture is
45
- * created with. Listing both keeps the map the whole of the answer — nothing here strips a suffix
46
- * and guesses. **A `snorm` format is not a tag**: its endpoints are signed and its palette runs over
47
- * a different domain, so it is its own shader.
48
- *
49
- * @readonly
50
- * @type {Map<GPUTextureFormat, ComputeShader>}
51
- */
52
- const ENCODERS = new Map([
53
- [TextureFormat.BC1_RGBA_UNORM, shader_texture_encode_bc1],
54
- [TextureFormat.BC1_RGBA_UNORM_SRGB, shader_texture_encode_bc1],
55
- [TextureFormat.BC4_R_UNORM, shader_texture_encode_bc4],
56
- [TextureFormat.BC4_R_SNORM, shader_texture_encode_bc4_snorm],
57
- [TextureFormat.BC5_RG_UNORM, shader_texture_encode_bc5],
58
- [TextureFormat.BC5_RG_SNORM, shader_texture_encode_bc5_snorm],
59
- [TextureFormat.BC6H_RGB_UFLOAT, shader_texture_encode_bc6h],
60
- [TextureFormat.BC7_RGBA_UNORM, shader_texture_encode_bc7],
61
- [TextureFormat.BC7_RGBA_UNORM_SRGB, shader_texture_encode_bc7],
62
- [TextureFormat.ASTC_4X4_UNORM, shader_texture_encode_astc_4x4],
63
- [TextureFormat.ASTC_4X4_UNORM_SRGB, shader_texture_encode_astc_4x4],
64
- ]);
65
-
66
- /**
67
- * The compute shader that encodes into `format`.
68
- *
69
- * Refuses by name rather than approximating: a target this cannot write yet is named as such, and a
70
- * format that was never a target is named as that. Nothing is encoded as a neighbour of what was
71
- * asked for.
72
- *
73
- * @param {GPUTextureFormat} format
74
- * @returns {ComputeShader}
75
- * @throws {Error} naming the format, for one that is not implemented or not a target
76
- */
77
- export function texture_encode_shader(format) {
78
- // throws for a name that is not a format at all, which is the first thing worth knowing
79
- gpu_texture_format_info(format);
80
-
81
- const shader = ENCODERS.get(format);
82
-
83
- if (shader !== undefined) {
84
- return shader;
85
- }
86
-
87
- if (TEXTURE_ENCODE_TARGETS.includes(format)) {
88
- throw new Error(
89
- `texture_encode: '${format}' is a planned target of the block encoder and is not implemented yet.`
90
- + ` Nothing approximates it; the implemented targets are ${[...ENCODERS.keys()].join(', ')}`
91
- );
92
- }
93
-
94
- throw new Error(
95
- `texture_encode: '${format}' is not a target of the block encoder.`
96
- + ` The targets are ${TEXTURE_ENCODE_TARGETS.join(', ')}`
97
- );
98
- }
99
-
100
- /**
101
- * Whether the block encoder can write `format` today.
102
- *
103
- * @param {GPUTextureFormat} format
104
- * @returns {boolean}
105
- */
106
- export function texture_encode_implements(format) {
107
- return ENCODERS.has(format);
108
- }
1
+ import { gpu_texture_format_info } from "../../../descriptor/texture/format/gpu_texture_format_info.js";
2
+ import { TextureFormat } from "../../../descriptor/texture/format/TextureFormat.js";
3
+ import { shader_texture_encode_astc_4x4 } from "./shader_texture_encode_astc_4x4.js";
4
+ import { shader_texture_encode_bc1 } from "./shader_texture_encode_bc1.js";
5
+ import { shader_texture_encode_bc4 } from "./shader_texture_encode_bc4.js";
6
+ import { shader_texture_encode_bc4_snorm } from "./shader_texture_encode_bc4_snorm.js";
7
+ import { shader_texture_encode_bc5 } from "./shader_texture_encode_bc5.js";
8
+ import { shader_texture_encode_bc5_snorm } from "./shader_texture_encode_bc5_snorm.js";
9
+ import { shader_texture_encode_bc6h } from "./shader_texture_encode_bc6h.js";
10
+ import { shader_texture_encode_bc7 } from "./shader_texture_encode_bc7.js";
11
+ import { shader_texture_encode_bc7_rgb } from "./shader_texture_encode_bc7_rgb.js";
12
+
13
+ /**
14
+ * Every format the block encoder is meant to write, implemented or not.
15
+ *
16
+ * The list the refusal below reads, so that a target that is planned and a name that was never a
17
+ * target get different answers: one says "not yet", the other "not at all".
18
+ *
19
+ * @readonly
20
+ * @type {GPUTextureFormat[]}
21
+ */
22
+ export const TEXTURE_ENCODE_TARGETS = [
23
+ TextureFormat.BC1_RGBA_UNORM,
24
+ TextureFormat.BC1_RGBA_UNORM_SRGB,
25
+ TextureFormat.BC4_R_UNORM,
26
+ TextureFormat.BC4_R_SNORM,
27
+ TextureFormat.BC5_RG_UNORM,
28
+ TextureFormat.BC5_RG_SNORM,
29
+ TextureFormat.BC6H_RGB_UFLOAT,
30
+ TextureFormat.BC7_RGBA_UNORM,
31
+ TextureFormat.BC7_RGBA_UNORM_SRGB,
32
+ TextureFormat.ASTC_4X4_UNORM,
33
+ TextureFormat.ASTC_4X4_UNORM_SRGB,
34
+ TextureFormat.ASTC_6X6_UNORM,
35
+ TextureFormat.ASTC_6X6_UNORM_SRGB,
36
+ TextureFormat.ASTC_8X8_UNORM,
37
+ TextureFormat.ASTC_8X8_UNORM_SRGB,
38
+ ];
39
+
40
+ /**
41
+ * The encoder for each implemented target.
42
+ *
43
+ * **An `-srgb` format and its linear twin are one encoder**, listed twice rather than resolved by
44
+ * stripping the suffix: the two are the same encoded bytes and differ only in how the sampler
45
+ * decodes them, so the encoder does identical work and the caller's format is the tag the texture is
46
+ * created with. Listing both keeps the map the whole of the answer — nothing here strips a suffix
47
+ * and guesses. **A `snorm` format is not a tag**: its endpoints are signed and its palette runs over
48
+ * a different domain, so it is its own shader.
49
+ *
50
+ * @readonly
51
+ * @type {Map<GPUTextureFormat, ComputeShader>}
52
+ */
53
+ const ENCODERS = new Map([
54
+ [TextureFormat.BC1_RGBA_UNORM, shader_texture_encode_bc1],
55
+ [TextureFormat.BC1_RGBA_UNORM_SRGB, shader_texture_encode_bc1],
56
+ [TextureFormat.BC4_R_UNORM, shader_texture_encode_bc4],
57
+ [TextureFormat.BC4_R_SNORM, shader_texture_encode_bc4_snorm],
58
+ [TextureFormat.BC5_RG_UNORM, shader_texture_encode_bc5],
59
+ [TextureFormat.BC5_RG_SNORM, shader_texture_encode_bc5_snorm],
60
+ [TextureFormat.BC6H_RGB_UFLOAT, shader_texture_encode_bc6h],
61
+ [TextureFormat.BC7_RGBA_UNORM, shader_texture_encode_bc7],
62
+ [TextureFormat.BC7_RGBA_UNORM_SRGB, shader_texture_encode_bc7],
63
+ [TextureFormat.ASTC_4X4_UNORM, shader_texture_encode_astc_4x4],
64
+ [TextureFormat.ASTC_4X4_UNORM_SRGB, shader_texture_encode_astc_4x4],
65
+ ]);
66
+
67
+ /**
68
+ * The encoder for each implemented target, for a texture whose alpha nobody reads: BC7's colour-only
69
+ * encoder, and every other target's own, none of which reads alpha.
70
+ *
71
+ * @readonly
72
+ * @type {Map<GPUTextureFormat, ComputeShader>}
73
+ */
74
+ const ENCODERS_RGB = new Map([
75
+ ...ENCODERS,
76
+ [TextureFormat.BC7_RGBA_UNORM, shader_texture_encode_bc7_rgb],
77
+ [TextureFormat.BC7_RGBA_UNORM_SRGB, shader_texture_encode_bc7_rgb],
78
+ ]);
79
+
80
+ /**
81
+ * The compute shader that encodes into `format`. For a texture whose alpha nobody reads,
82
+ * {@link texture_encode_shader_rgb}.
83
+ *
84
+ * Refuses by name rather than approximating: a target this cannot write yet is named as such, and a
85
+ * format that was never a target is named as that. Nothing is encoded as a neighbour of what was
86
+ * asked for.
87
+ *
88
+ * @param {GPUTextureFormat} format
89
+ * @returns {ComputeShader}
90
+ * @throws {Error} naming the format, for one that is not implemented or not a target
91
+ */
92
+ export function texture_encode_shader(format) {
93
+ return encoder_from(ENCODERS, format);
94
+ }
95
+
96
+ /**
97
+ * The compute shader that encodes into `format` a texture whose alpha nobody reads: the source's alpha
98
+ * is not read, and the blocks decode to whatever alpha served the colour. For BC7 that frees the low
99
+ * bit each end's channels share with alpha ({@link shader_texture_encode_bc7_rgb}); every other
100
+ * target is the shader {@link texture_encode_shader} gives, as none of them reads alpha.
101
+ *
102
+ * @param {GPUTextureFormat} format
103
+ * @returns {ComputeShader}
104
+ * @throws {Error} naming the format, for one that is not implemented or not a target
105
+ */
106
+ export function texture_encode_shader_rgb(format) {
107
+ return encoder_from(ENCODERS_RGB, format);
108
+ }
109
+
110
+ /**
111
+ * @param {Map<GPUTextureFormat, ComputeShader>} encoders
112
+ * @param {GPUTextureFormat} format
113
+ * @returns {ComputeShader}
114
+ */
115
+ function encoder_from(encoders, format) {
116
+ // throws for a name that is not a format at all, which is the first thing worth knowing
117
+ gpu_texture_format_info(format);
118
+
119
+ const shader = encoders.get(format);
120
+
121
+ if (shader !== undefined) {
122
+ return shader;
123
+ }
124
+
125
+ if (TEXTURE_ENCODE_TARGETS.includes(format)) {
126
+ throw new Error(
127
+ `texture_encode: '${format}' is a planned target of the block encoder and is not implemented yet.`
128
+ + ` Nothing approximates it; the implemented targets are ${[...ENCODERS.keys()].join(', ')}`
129
+ );
130
+ }
131
+
132
+ throw new Error(
133
+ `texture_encode: '${format}' is not a target of the block encoder.`
134
+ + ` The targets are ${TEXTURE_ENCODE_TARGETS.join(', ')}`
135
+ );
136
+ }
137
+
138
+ /**
139
+ * Whether the block encoder can write `format` today.
140
+ *
141
+ * @param {GPUTextureFormat} format
142
+ * @returns {boolean}
143
+ */
144
+ export function texture_encode_implements(format) {
145
+ return ENCODERS.has(format);
146
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The block formats to build for a texture with this role so that every device finds the one it would choose.
3
+ *
4
+ * Each device picks the first entry of {@link texture_format_preference} it can sample. This is the set of those
5
+ * picks over every kind of device WebGPU allows, and nothing else: a format no device would pick is never fetched,
6
+ * and leaving out one a device would pick sends that device to the uncompressed fallback. The order is the
7
+ * preference order.
8
+ *
9
+ * Names are the non-sRGB ones, as the preference list's are; the sRGB variant is the same bytes.
10
+ *
11
+ * @param {TextureRole|number} role
12
+ * @returns {GPUTextureFormat[]}
13
+ * @throws {Error} for a value that is not a {@link TextureRole}
14
+ *
15
+ * @author Alex Goldring
16
+ * @copyright Company Named Limited (c) 2026
17
+ */
18
+ export function texture_formats_to_build(role: TextureRole | number): GPUTextureFormat[];
19
+ import { TextureRole } from "../TextureRole.js";
20
+ //# sourceMappingURL=texture_formats_to_build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"texture_formats_to_build.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/texture/format/texture_formats_to_build.js"],"names":[],"mappings":"AA+DA;;;;;;;;;;;;;;;;GAgBG;AACH,+CAPW,WAAW,GAAC,MAAM,GAChB,kBAAkB,CAuB9B;4BA9F2B,mBAAmB"}
@@ -0,0 +1,98 @@
1
+ import { gpu_texture_format_feature } from "../../../descriptor/texture/format/gpu_texture_format_feature.js";
2
+ import { gpu_texture_format_names } from "../../../descriptor/texture/format/gpu_texture_format_info.js";
3
+ import { WebGPUExtensionType } from "../../../descriptor/WebGPUExtensionType.js";
4
+ import { TextureRole } from "../TextureRole.js";
5
+ import { texture_format_preference } from "./texture_format_preference.js";
6
+
7
+ /**
8
+ * What WebGPU promises of every adapter's compression support: at least one of these sets of features is
9
+ * supported whole (WebGPU, "Adapter Capability Guarantees").
10
+ *
11
+ * @readonly
12
+ * @type {GPUFeatureName[][]}
13
+ */
14
+ const ADAPTER_GUARANTEE = [
15
+ [WebGPUExtensionType.TextureCompressionBC],
16
+ [WebGPUExtensionType.TextureCompressionETC2, WebGPUExtensionType.TextureCompressionASTC],
17
+ ];
18
+
19
+ /**
20
+ * Every compressed format, by the feature it arrives under.
21
+ *
22
+ * @readonly
23
+ * @type {Map<GPUFeatureName, GPUTextureFormat[]>}
24
+ */
25
+ const FORMATS_BY_FEATURE = new Map();
26
+
27
+ for (const format of gpu_texture_format_names()) {
28
+ const feature = gpu_texture_format_feature(format);
29
+
30
+ if (feature === undefined) {
31
+ continue;
32
+ }
33
+
34
+ if (!FORMATS_BY_FEATURE.has(feature)) {
35
+ FORMATS_BY_FEATURE.set(feature, []);
36
+ }
37
+
38
+ FORMATS_BY_FEATURE.get(feature).push(format);
39
+ }
40
+
41
+ /**
42
+ * What each kind of device WebGPU allows can sample: one set of formats for every combination of compression
43
+ * features that meets {@link ADAPTER_GUARANTEE}.
44
+ *
45
+ * @readonly
46
+ * @type {Set<GPUTextureFormat>[]}
47
+ */
48
+ const DEVICES = [];
49
+
50
+ {
51
+ const features = [...FORMATS_BY_FEATURE.keys()];
52
+
53
+ for (let mask = 0; mask < (1 << features.length); mask++) {
54
+ const has = features.filter((feature, bit) => (mask & (1 << bit)) !== 0);
55
+
56
+ if (!ADAPTER_GUARANTEE.some(required => required.every(feature => has.includes(feature)))) {
57
+ continue;
58
+ }
59
+
60
+ DEVICES.push(new Set(has.flatMap(feature => FORMATS_BY_FEATURE.get(feature))));
61
+ }
62
+ }
63
+
64
+ /**
65
+ * The block formats to build for a texture with this role so that every device finds the one it would choose.
66
+ *
67
+ * Each device picks the first entry of {@link texture_format_preference} it can sample. This is the set of those
68
+ * picks over every kind of device WebGPU allows, and nothing else: a format no device would pick is never fetched,
69
+ * and leaving out one a device would pick sends that device to the uncompressed fallback. The order is the
70
+ * preference order.
71
+ *
72
+ * Names are the non-sRGB ones, as the preference list's are; the sRGB variant is the same bytes.
73
+ *
74
+ * @param {TextureRole|number} role
75
+ * @returns {GPUTextureFormat[]}
76
+ * @throws {Error} for a value that is not a {@link TextureRole}
77
+ *
78
+ * @author Alex Goldring
79
+ * @copyright Company Named Limited (c) 2026
80
+ */
81
+ export function texture_formats_to_build(role) {
82
+ if (!Object.values(TextureRole).includes(role)) {
83
+ throw new Error(`${role} is not a TextureRole`);
84
+ }
85
+
86
+ const chosen = new Set();
87
+
88
+ for (const support of DEVICES) {
89
+ const format = texture_format_preference(role, support)[0];
90
+
91
+ if (format !== undefined) {
92
+ chosen.add(format);
93
+ }
94
+ }
95
+
96
+ // in preference order, which is the order of the list every device reads
97
+ return texture_format_preference(role, chosen);
98
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"WebGPUMipmapGenerator.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.js"],"names":[],"mappings":"AAgNA;;;GAGG;AACH;IAoEI;;;OAGG;IACH,+BAkBC;IAzFD;;OAEG;IACH,kBAAM;IAEN;;;;OAIG;IACH,oBAFU,QAAQ,eAAe,oBAAoB,CAE3B;IAE1B;;OAEG;IACH,oBAAQ;IA4CR,gBAMC;IAoED;;;;;OAKG;IACH,yEAFW,iBAAiB,QAY3B;IAED;;;OAGG;IACH,wBAFW,MAAM,QAyBhB;IAED;;OAEG;IACH,cAEC;IA+HG,qBAiBE;IAEF,oBAGE;IAGN;;;;;;;;;;;;OAYG;IACH,uFARW,iBAAiB,6DAIjB;QAAC,OAAO,QAAa,IAAI,CAAA;KAAC,EAAE,cAYtC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,2FATW,iBAAiB,WACjB,YAAY,gBAGZ,MAAM,6DAEN;QAAC,OAAO,QAAa,IAAI,CAAA;KAAC,EAAE,cAsBtC;;CAscJ;wBAviCuB,4CAA4C;AA2CpE;IAEI;;OAEG;IACH,yBAAO;IAEP;;OAEG;IACH;;;;QA1BA;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;;;MAgBI;IAEP;;;OAGG;IACH,SAFU,OAAO,CAED;IAEhB;;;;OAIG;IACH,cAHW,eAAe,GACd,OAAO,CAOlB;IAED;;;OAGG;IACH,QAFY,MAAM,CAOjB;CAEJ;kCA1EiC,yBAAyB"}
1
+ {"version":3,"file":"WebGPUMipmapGenerator.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.js"],"names":[],"mappings":"AA8LA;;;GAGG;AACH;IAoEI;;;OAGG;IACH,+BAiBC;IAxFD;;OAEG;IACH,kBAAM;IAEN;;;;OAIG;IACH,oBAFU,QAAQ,eAAe,oBAAoB,CAE3B;IAE1B;;OAEG;IACH,oBAAQ;IA4CR,gBAMC;IAmED;;;;;OAKG;IACH,yEAFW,iBAAiB,QAY3B;IAED;;;OAGG;IACH,wBAFW,MAAM,QAyBhB;IAED;;OAEG;IACH,cAEC;IA+HG,qBAiBE;IAEF,oBAGE;IAGN;;;;;;;;;;;;OAYG;IACH,uFARW,iBAAiB,6DAIjB;QAAC,OAAO,QAAa,IAAI,CAAA;KAAC,EAAE,cAYtC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,2FATW,iBAAiB,WACjB,YAAY,gBAGZ,MAAM,6DAEN;QAAC,OAAO,QAAa,IAAI,CAAA;KAAC,EAAE,cAsBtC;;CAscJ;wBAphCuB,4CAA4C;AA2CpE;IAEI;;OAEG;IACH,yBAAO;IAEP;;OAEG;IACH;;;;QA1BA;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;;;MAgBI;IAEP;;;OAGG;IACH,SAFU,OAAO,CAED;IAEhB;;;;OAIG;IACH,cAHW,eAAe,GACd,OAAO,CAOlB;IAED;;;OAGG;IACH,QAFY,MAAM,CAOjB;CAEJ;kCA1EiC,yBAAyB"}
@@ -102,12 +102,6 @@ class FilterProcessDescriptor {
102
102
  */
103
103
  base_filter;
104
104
 
105
- /**
106
- * Kernel support size, in output pixels.
107
- * @type {number}
108
- */
109
- support = 1;
110
-
111
105
  /**
112
106
  * How far back to sample from, in mipmap levels.
113
107
  * Only valid when {@link base_filter} and {@link filter} are different.
@@ -118,21 +112,16 @@ class FilterProcessDescriptor {
118
112
  /**
119
113
  *
120
114
  * @param {Object} options
121
- * @param {number} options.support
122
115
  * @param {number} [options.skip_distance]
123
116
  * @param {FilterShaderType} options.filter
124
117
  * @param {FilterShaderType} options.base_filter
125
118
  * @returns {FilterProcessDescriptor}
126
119
  */
127
120
  static from({
128
- support = 1,
129
121
  skip_distance = 0,
130
122
  filter = FilterShaderType.Linear,
131
123
  base_filter = FilterShaderType.Linear,
132
124
  }) {
133
- assert.isNumber(support, 'support');
134
- assert.greaterThanOrEqual(support, 0, 'support');
135
-
136
125
  assert.isNumber(skip_distance, 'skip_distance');
137
126
  assert.isNonNegativeInteger(skip_distance, 'skip_distance');
138
127
 
@@ -140,7 +129,6 @@ class FilterProcessDescriptor {
140
129
 
141
130
  r.filter = filter;
142
131
  r.base_filter = base_filter;
143
- r.support = support;
144
132
  r.skip_distance = skip_distance;
145
133
 
146
134
  return r;
@@ -158,35 +146,29 @@ const DEFAULT_SKIP_DISTANCE = 2;
158
146
  */
159
147
  const FILTER_PROCESSES = {
160
148
  [TextureFilterType.Linear]: FilterProcessDescriptor.from({
161
- support: 1,
162
149
  filter: FilterShaderType.Linear,
163
150
  base_filter: FilterShaderType.Linear,
164
151
  }),
165
152
  [TextureFilterType.LinearNormal]: FilterProcessDescriptor.from({
166
- support: 1,
167
153
  filter: FilterShaderType.LinearNormal,
168
154
  base_filter: FilterShaderType.Linear,
169
155
  }),
170
156
  [TextureFilterType.Mitchell]: FilterProcessDescriptor.from({
171
- support: 2,
172
157
  filter: FilterShaderType.Mitchell,
173
158
  skip_distance: DEFAULT_SKIP_DISTANCE,
174
159
  base_filter: FilterShaderType.MagicKernelBase,
175
160
  }),
176
161
  [TextureFilterType.MagicKernelSharp]: FilterProcessDescriptor.from({
177
- support: 3.5,
178
162
  filter: FilterShaderType.MagicKernelSharp,
179
163
  skip_distance: 1,
180
164
  base_filter: FilterShaderType.MagicKernelSharp,
181
165
  }),
182
166
  [TextureFilterType.CatmullRom]: FilterProcessDescriptor.from({
183
- support: 2,
184
167
  filter: FilterShaderType.CatmullRom,
185
168
  skip_distance: DEFAULT_SKIP_DISTANCE,
186
169
  base_filter: FilterShaderType.Linear,
187
170
  }),
188
171
  [TextureFilterType.Wronski2021]: FilterProcessDescriptor.from({
189
- support: 5,
190
172
  filter: FilterShaderType.Wronski2021,
191
173
  skip_distance: 1,
192
174
  base_filter: FilterShaderType.Linear,
@@ -286,10 +268,9 @@ export class WebGPUMipmapGenerator {
286
268
  this.device = device;
287
269
 
288
270
  /*
289
- `magFilter` as well as `minFilter`. Most filters read exact texels with `textureLoad`, and the
290
- linear one samples a level twice the size of its target, which is minification. Wronski2021
291
- samples between texels at an explicit level 0, and an explicit level 0 is magnification: at
292
- the default 'nearest', every one of its bilinear taps read a single texel.
271
+ `magFilter` as well as `minFilter`. Most filters read exact texels with `textureLoad`.
272
+ Wronski2021 and the atlas region reduction sample between texels at an explicit level 0, and
273
+ an explicit level 0 is magnification, so it is `magFilter` that makes their taps bilinear.
293
274
  */
294
275
  this.sampler = device.createSampler({ minFilter: 'linear', magFilter: 'linear' });
295
276
 
@@ -408,7 +389,7 @@ export class WebGPUMipmapGenerator {
408
389
 
409
390
  assert.enum(filter, FilterShaderType, 'filter');
410
391
 
411
- const filter_key_name = objectKeyByValue(TextureFilterType, filter);
392
+ const filter_key_name = objectKeyByValue(FilterShaderType, filter);
412
393
 
413
394
  /**
414
395
  * @type {CodeChunk}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Bilinear sample footprints along one axis of a source level: for each slot, the two texels a
3
+ * linear, clamp-to-edge sampler blends and their weights.
4
+ *
5
+ * A slot is placed from a normalised coordinate as the sampler places it: `p = uv * size - 0.5`, the
6
+ * texels `floor(p)` and `floor(p) + 1` clamped into the level, weighed `1 - fract(p)` and `fract(p)`.
7
+ * The weights are kept at double precision, unrounded, as `cpu_texture_sample` forms them.
8
+ *
9
+ * @author Alex Goldring
10
+ * @copyright Company Named Limited (c) 2026
11
+ */
12
+ export class MipmapBilinearAxis {
13
+ /**
14
+ * @param {number} slot_count
15
+ */
16
+ constructor(slot_count: number);
17
+ /**
18
+ * @readonly
19
+ * @type {Uint32Array}
20
+ */
21
+ readonly lower: Uint32Array;
22
+ /**
23
+ * @readonly
24
+ * @type {Uint32Array}
25
+ */
26
+ readonly upper: Uint32Array;
27
+ /**
28
+ * @readonly
29
+ * @type {Float64Array}
30
+ */
31
+ readonly lower_weight: Float64Array;
32
+ /**
33
+ * @readonly
34
+ * @type {Float64Array}
35
+ */
36
+ readonly upper_weight: Float64Array;
37
+ /**
38
+ * Place `slot` at normalised coordinate `uv` of an axis `size` texels long.
39
+ *
40
+ * @param {number} slot
41
+ * @param {number} uv an f32
42
+ * @param {number} size
43
+ */
44
+ place(slot: number, uv: number, size: number): void;
45
+ /**
46
+ * Place `slot` on an axis one texel long that is sampled as a texture of one dimension fewer:
47
+ * texel 0 with a weight of exactly 1, wherever along the axis the sample falls.
48
+ *
49
+ * @param {number} slot
50
+ */
51
+ place_single(slot: number): void;
52
+ }
53
+ //# sourceMappingURL=MipmapBilinearAxis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MipmapBilinearAxis.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.js"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH;IACI;;OAEG;IACH,wBAFW,MAAM,EA0BhB;IAvBG;;;OAGG;IACH,gBAFU,WAAW,CAEmB;IAExC;;;OAGG;IACH,gBAFU,WAAW,CAEmB;IAExC;;;OAGG;IACH,uBAFU,YAAY,CAE0B;IAEhD;;;OAGG;IACH,uBAFU,YAAY,CAE0B;IAGpD;;;;;;OAMG;IACH,YAJW,MAAM,MACN,MAAM,QACN,MAAM,QAchB;IAED;;;;;OAKG;IACH,mBAFW,MAAM,QAQhB;CACJ"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Bilinear sample footprints along one axis of a source level: for each slot, the two texels a
3
+ * linear, clamp-to-edge sampler blends and their weights.
4
+ *
5
+ * A slot is placed from a normalised coordinate as the sampler places it: `p = uv * size - 0.5`, the
6
+ * texels `floor(p)` and `floor(p) + 1` clamped into the level, weighed `1 - fract(p)` and `fract(p)`.
7
+ * The weights are kept at double precision, unrounded, as `cpu_texture_sample` forms them.
8
+ *
9
+ * @author Alex Goldring
10
+ * @copyright Company Named Limited (c) 2026
11
+ */
12
+ export class MipmapBilinearAxis {
13
+ /**
14
+ * @param {number} slot_count
15
+ */
16
+ constructor(slot_count) {
17
+ /**
18
+ * @readonly
19
+ * @type {Uint32Array}
20
+ */
21
+ this.lower = new Uint32Array(slot_count);
22
+
23
+ /**
24
+ * @readonly
25
+ * @type {Uint32Array}
26
+ */
27
+ this.upper = new Uint32Array(slot_count);
28
+
29
+ /**
30
+ * @readonly
31
+ * @type {Float64Array}
32
+ */
33
+ this.lower_weight = new Float64Array(slot_count);
34
+
35
+ /**
36
+ * @readonly
37
+ * @type {Float64Array}
38
+ */
39
+ this.upper_weight = new Float64Array(slot_count);
40
+ }
41
+
42
+ /**
43
+ * Place `slot` at normalised coordinate `uv` of an axis `size` texels long.
44
+ *
45
+ * @param {number} slot
46
+ * @param {number} uv an f32
47
+ * @param {number} size
48
+ */
49
+ place(slot, uv, size) {
50
+ const p = uv * size - 0.5;
51
+ const below = Math.floor(p);
52
+ const fraction = p - below;
53
+
54
+ const last = size - 1;
55
+
56
+ this.lower[slot] = below < 0 ? 0 : (below > last ? last : below);
57
+ this.upper[slot] = below + 1 < 0 ? 0 : (below + 1 > last ? last : below + 1);
58
+
59
+ this.lower_weight[slot] = 1 - fraction;
60
+ this.upper_weight[slot] = fraction;
61
+ }
62
+
63
+ /**
64
+ * Place `slot` on an axis one texel long that is sampled as a texture of one dimension fewer:
65
+ * texel 0 with a weight of exactly 1, wherever along the axis the sample falls.
66
+ *
67
+ * @param {number} slot
68
+ */
69
+ place_single(slot) {
70
+ this.lower[slot] = 0;
71
+ this.upper[slot] = 0;
72
+
73
+ this.lower_weight[slot] = 1;
74
+ this.upper_weight[slot] = 0;
75
+ }
76
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The taps of a separable reduction kernel along one axis: for each destination texel, the run of
3
+ * source texels it weighs and the f32 weight of each, in ascending source order.
4
+ *
5
+ * Taps of zero weight are left out: a tap adds its texel times its weight to the sum, and its weight
6
+ * to the weight sum, so a zero weight changes neither.
7
+ *
8
+ * @author Alex Goldring
9
+ * @copyright Company Named Limited (c) 2026
10
+ */
11
+ export class MipmapKernelAxis {
12
+ /**
13
+ * @param {number} output_size destination texels along the axis
14
+ * @param {number} capacity most taps any one destination texel can have
15
+ */
16
+ constructor(output_size: number, capacity: number);
17
+ /**
18
+ * Index into {@link index} and {@link weight} of each destination texel's first tap.
19
+ * @readonly
20
+ * @type {Uint32Array}
21
+ */
22
+ readonly first: Uint32Array;
23
+ /**
24
+ * @readonly
25
+ * @type {Uint32Array}
26
+ */
27
+ readonly count: Uint32Array;
28
+ /**
29
+ * Source texel of each tap.
30
+ * @readonly
31
+ * @type {Uint32Array}
32
+ */
33
+ readonly index: Uint32Array;
34
+ /**
35
+ * @readonly
36
+ * @type {Float32Array}
37
+ */
38
+ readonly weight: Float32Array;
39
+ }
40
+ //# sourceMappingURL=MipmapKernelAxis.d.ts.map