@woosh/meep-engine 3.9.0 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +168 -152
- package/build/bundle-worker-image-decoder.js +1 -1
- package/build/bundle-worker-terrain.js +1 -1
- package/package.json +3 -2
- package/src/REVIEW_2026_08_06.md +610 -610
- package/src/avif/encode_image_source.d.ts +70 -0
- package/src/avif/encode_image_source.d.ts.map +1 -0
- package/src/avif/encode_image_source.js +117 -0
- package/src/avif/encoder_worker.js +15 -126
- package/src/avif/index.d.ts +4 -2
- package/src/avif/index.js +21 -2
- package/src/avif/native/DECISIONS.md +537 -0
- package/src/avif/native/NOTICE.md +61 -0
- package/src/avif/native/api/AvifDecoder.d.ts +67 -0
- package/src/avif/native/api/AvifDecoder.d.ts.map +1 -0
- package/src/avif/native/api/AvifDecoder.js +121 -0
- package/src/avif/native/api/apply_transformations.d.ts +30 -0
- package/src/avif/native/api/apply_transformations.d.ts.map +1 -0
- package/src/avif/native/api/apply_transformations.js +120 -0
- package/src/avif/native/api/avif_to_sampler2d.d.ts +25 -0
- package/src/avif/native/api/avif_to_sampler2d.d.ts.map +1 -0
- package/src/avif/native/api/avif_to_sampler2d.js +42 -0
- package/src/avif/native/api/convert_to_rgba.d.ts +54 -0
- package/src/avif/native/api/convert_to_rgba.d.ts.map +1 -0
- package/src/avif/native/api/convert_to_rgba.js +204 -0
- package/src/avif/native/api/decode_avif.d.ts +24 -0
- package/src/avif/native/api/decode_avif.d.ts.map +1 -0
- package/src/avif/native/api/decode_avif.js +111 -0
- package/src/avif/native/api/decode_image_item.d.ts +18 -0
- package/src/avif/native/api/decode_image_item.d.ts.map +1 -0
- package/src/avif/native/api/decode_image_item.js +234 -0
- package/src/avif/native/api/encode_avif.d.ts +73 -0
- package/src/avif/native/api/encode_avif.d.ts.map +1 -0
- package/src/avif/native/api/encode_avif.js +488 -0
- package/src/avif/native/api/sampler2d_to_avif.d.ts +22 -0
- package/src/avif/native/api/sampler2d_to_avif.d.ts.map +1 -0
- package/src/avif/native/api/sampler2d_to_avif.js +108 -0
- package/src/avif/native/av1/decode/Av1FrameContext.d.ts +286 -0
- package/src/avif/native/av1/decode/Av1FrameContext.d.ts.map +1 -0
- package/src/avif/native/av1/decode/Av1FrameContext.js +622 -0
- package/src/avif/native/av1/decode/block_decoded.d.ts +27 -0
- package/src/avif/native/av1/decode/block_decoded.d.ts.map +1 -0
- package/src/avif/native/av1/decode/block_decoded.js +59 -0
- package/src/avif/native/av1/decode/decode_av1_still.d.ts +22 -0
- package/src/avif/native/av1/decode/decode_av1_still.d.ts.map +1 -0
- package/src/avif/native/av1/decode/decode_av1_still.js +309 -0
- package/src/avif/native/av1/decode/decode_coefficients.d.ts +20 -0
- package/src/avif/native/av1/decode/decode_coefficients.d.ts.map +1 -0
- package/src/avif/native/av1/decode/decode_coefficients.js +259 -0
- package/src/avif/native/av1/decode/decode_palette.d.ts +28 -0
- package/src/avif/native/av1/decode/decode_palette.d.ts.map +1 -0
- package/src/avif/native/av1/decode/decode_palette.js +442 -0
- package/src/avif/native/av1/decode/decode_tile.d.ts +14 -0
- package/src/avif/native/av1/decode/decode_tile.d.ts.map +1 -0
- package/src/avif/native/av1/decode/decode_tile.js +1213 -0
- package/src/avif/native/av1/decode/get_scan.d.ts +16 -0
- package/src/avif/native/av1/decode/get_scan.d.ts.map +1 -0
- package/src/avif/native/av1/decode/get_scan.js +138 -0
- package/src/avif/native/av1/decode/read_lr.d.ts +35 -0
- package/src/avif/native/av1/decode/read_lr.d.ts.map +1 -0
- package/src/avif/native/av1/decode/read_lr.js +277 -0
- package/src/avif/native/av1/decode/read_transform_type.d.ts +19 -0
- package/src/avif/native/av1/decode/read_transform_type.d.ts.map +1 -0
- package/src/avif/native/av1/decode/read_transform_type.js +92 -0
- package/src/avif/native/av1/decode/reconstruct.d.ts +36 -0
- package/src/avif/native/av1/decode/reconstruct.d.ts.map +1 -0
- package/src/avif/native/av1/decode/reconstruct.js +241 -0
- package/src/avif/native/av1/decode/transform_type.d.ts +49 -0
- package/src/avif/native/av1/decode/transform_type.d.ts.map +1 -0
- package/src/avif/native/av1/decode/transform_type.js +137 -0
- package/src/avif/native/av1/encode/Av1BlockSnapshot.d.ts +81 -0
- package/src/avif/native/av1/encode/Av1BlockSnapshot.d.ts.map +1 -0
- package/src/avif/native/av1/encode/Av1BlockSnapshot.js +299 -0
- package/src/avif/native/av1/encode/Av1EncodeContext.d.ts +384 -0
- package/src/avif/native/av1/encode/Av1EncodeContext.d.ts.map +1 -0
- package/src/avif/native/av1/encode/Av1EncodeContext.js +590 -0
- package/src/avif/native/av1/encode/build_headers.d.ts +50 -0
- package/src/avif/native/av1/encode/build_headers.d.ts.map +1 -0
- package/src/avif/native/av1/encode/build_headers.js +359 -0
- package/src/avif/native/av1/encode/choose_chroma_alpha.d.ts +26 -0
- package/src/avif/native/av1/encode/choose_chroma_alpha.d.ts.map +1 -0
- package/src/avif/native/av1/encode/choose_chroma_alpha.js +90 -0
- package/src/avif/native/av1/encode/choose_filters.d.ts +21 -0
- package/src/avif/native/av1/encode/choose_filters.d.ts.map +1 -0
- package/src/avif/native/av1/encode/choose_filters.js +318 -0
- package/src/avif/native/av1/encode/choose_restoration.d.ts +35 -0
- package/src/avif/native/av1/encode/choose_restoration.d.ts.map +1 -0
- package/src/avif/native/av1/encode/choose_restoration.js +616 -0
- package/src/avif/native/av1/encode/decode_effort.d.ts +57 -0
- package/src/avif/native/av1/encode/decode_effort.d.ts.map +1 -0
- package/src/avif/native/av1/encode/decode_effort.js +59 -0
- package/src/avif/native/av1/encode/encode_av1_still.d.ts +17 -0
- package/src/avif/native/av1/encode/encode_av1_still.d.ts.map +1 -0
- package/src/avif/native/av1/encode/encode_av1_still.js +194 -0
- package/src/avif/native/av1/encode/encode_effort.d.ts +56 -0
- package/src/avif/native/av1/encode/encode_effort.d.ts.map +1 -0
- package/src/avif/native/av1/encode/encode_effort.js +97 -0
- package/src/avif/native/av1/encode/encode_tile.d.ts +26 -0
- package/src/avif/native/av1/encode/encode_tile.d.ts.map +1 -0
- package/src/avif/native/av1/encode/encode_tile.js +2331 -0
- package/src/avif/native/av1/encode/quantise.d.ts +51 -0
- package/src/avif/native/av1/encode/quantise.d.ts.map +1 -0
- package/src/avif/native/av1/encode/quantise.js +212 -0
- package/src/avif/native/av1/encode/write_coefficients.d.ts +42 -0
- package/src/avif/native/av1/encode/write_coefficients.d.ts.map +1 -0
- package/src/avif/native/av1/encode/write_coefficients.js +367 -0
- package/src/avif/native/av1/encode/write_lr.d.ts +33 -0
- package/src/avif/native/av1/encode/write_lr.d.ts.map +1 -0
- package/src/avif/native/av1/encode/write_lr.js +174 -0
- package/src/avif/native/av1/encode/write_transform_type.d.ts +21 -0
- package/src/avif/native/av1/encode/write_transform_type.d.ts.map +1 -0
- package/src/avif/native/av1/encode/write_transform_type.js +70 -0
- package/src/avif/native/av1/entropy/CdfContext.d.ts +167 -0
- package/src/avif/native/av1/entropy/CdfContext.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/CdfContext.js +433 -0
- package/src/avif/native/av1/entropy/SymbolReader.d.ts +103 -0
- package/src/avif/native/av1/entropy/SymbolReader.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/SymbolReader.js +317 -0
- package/src/avif/native/av1/entropy/SymbolWriter.d.ts +107 -0
- package/src/avif/native/av1/entropy/SymbolWriter.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/SymbolWriter.js +352 -0
- package/src/avif/native/av1/entropy/coefficient_context.d.ts +71 -0
- package/src/avif/native/av1/entropy/coefficient_context.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/coefficient_context.js +325 -0
- package/src/avif/native/av1/entropy/partition_cdf.d.ts +54 -0
- package/src/avif/native/av1/entropy/partition_cdf.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/partition_cdf.js +98 -0
- package/src/avif/native/av1/entropy/symbol_cost.d.ts +37 -0
- package/src/avif/native/av1/entropy/symbol_cost.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/symbol_cost.js +76 -0
- package/src/avif/native/av1/filter/cdef.d.ts +15 -0
- package/src/avif/native/av1/filter/cdef.d.ts.map +1 -0
- package/src/avif/native/av1/filter/cdef.js +313 -0
- package/src/avif/native/av1/filter/loop_filter.d.ts +14 -0
- package/src/avif/native/av1/filter/loop_filter.d.ts.map +1 -0
- package/src/avif/native/av1/filter/loop_filter.js +377 -0
- package/src/avif/native/av1/filter/loop_restoration.d.ts +42 -0
- package/src/avif/native/av1/filter/loop_restoration.d.ts.map +1 -0
- package/src/avif/native/av1/filter/loop_restoration.js +451 -0
- package/src/avif/native/av1/filter/superres.d.ts +18 -0
- package/src/avif/native/av1/filter/superres.d.ts.map +1 -0
- package/src/avif/native/av1/filter/superres.js +86 -0
- package/src/avif/native/av1/grain/FilmGrainState.d.ts +62 -0
- package/src/avif/native/av1/grain/FilmGrainState.d.ts.map +1 -0
- package/src/avif/native/av1/grain/FilmGrainState.js +87 -0
- package/src/avif/native/av1/grain/film_grain.d.ts +16 -0
- package/src/avif/native/av1/grain/film_grain.d.ts.map +1 -0
- package/src/avif/native/av1/grain/film_grain.js +623 -0
- package/src/avif/native/av1/obu/FrameHeader.d.ts +248 -0
- package/src/avif/native/av1/obu/FrameHeader.d.ts.map +1 -0
- package/src/avif/native/av1/obu/FrameHeader.js +381 -0
- package/src/avif/native/av1/obu/ObuHeader.d.ts +53 -0
- package/src/avif/native/av1/obu/ObuHeader.d.ts.map +1 -0
- package/src/avif/native/av1/obu/ObuHeader.js +62 -0
- package/src/avif/native/av1/obu/SequenceHeader.d.ts +157 -0
- package/src/avif/native/av1/obu/SequenceHeader.d.ts.map +1 -0
- package/src/avif/native/av1/obu/SequenceHeader.js +225 -0
- package/src/avif/native/av1/obu/for_each_obu.d.ts +24 -0
- package/src/avif/native/av1/obu/for_each_obu.d.ts.map +1 -0
- package/src/avif/native/av1/obu/for_each_obu.js +50 -0
- package/src/avif/native/av1/obu/parse_frame_header.d.ts +18 -0
- package/src/avif/native/av1/obu/parse_frame_header.d.ts.map +1 -0
- package/src/avif/native/av1/obu/parse_frame_header.js +841 -0
- package/src/avif/native/av1/obu/parse_obu_header.d.ts +23 -0
- package/src/avif/native/av1/obu/parse_obu_header.d.ts.map +1 -0
- package/src/avif/native/av1/obu/parse_obu_header.js +69 -0
- package/src/avif/native/av1/obu/parse_sequence_header.d.ts +17 -0
- package/src/avif/native/av1/obu/parse_sequence_header.d.ts.map +1 -0
- package/src/avif/native/av1/obu/parse_sequence_header.js +263 -0
- package/src/avif/native/av1/obu/write_frame_header.d.ts +16 -0
- package/src/avif/native/av1/obu/write_frame_header.d.ts.map +1 -0
- package/src/avif/native/av1/obu/write_frame_header.js +579 -0
- package/src/avif/native/av1/obu/write_sequence_header.d.ts +17 -0
- package/src/avif/native/av1/obu/write_sequence_header.d.ts.map +1 -0
- package/src/avif/native/av1/obu/write_sequence_header.js +189 -0
- package/src/avif/native/av1/predict/IntraPredictionState.d.ts +49 -0
- package/src/avif/native/av1/predict/IntraPredictionState.d.ts.map +1 -0
- package/src/avif/native/av1/predict/IntraPredictionState.js +58 -0
- package/src/avif/native/av1/predict/intra_filter_type.d.ts +17 -0
- package/src/avif/native/av1/predict/intra_filter_type.d.ts.map +1 -0
- package/src/avif/native/av1/predict/intra_filter_type.js +79 -0
- package/src/avif/native/av1/predict/predict_chroma_from_luma.d.ts +50 -0
- package/src/avif/native/av1/predict/predict_chroma_from_luma.d.ts.map +1 -0
- package/src/avif/native/av1/predict/predict_chroma_from_luma.js +153 -0
- package/src/avif/native/av1/predict/predict_intra.d.ts +42 -0
- package/src/avif/native/av1/predict/predict_intra.d.ts.map +1 -0
- package/src/avif/native/av1/predict/predict_intra.js +803 -0
- package/src/avif/native/av1/predict/predict_palette.d.ts +23 -0
- package/src/avif/native/av1/predict/predict_palette.d.ts.map +1 -0
- package/src/avif/native/av1/predict/predict_palette.js +36 -0
- package/src/avif/native/av1/tables/av1_symbols.d.ts +411 -0
- package/src/avif/native/av1/tables/av1_symbols.d.ts.map +1 -0
- package/src/avif/native/av1/tables/av1_symbols.js +419 -0
- package/src/avif/native/av1/tables/block_tables.d.ts +181 -0
- package/src/avif/native/av1/tables/block_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/block_tables.js +270 -0
- package/src/avif/native/av1/tables/cdf_tables.d.ts +961 -0
- package/src/avif/native/av1/tables/cdf_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/cdf_tables.js +1893 -0
- package/src/avif/native/av1/tables/coefficient_tables.d.ts +41 -0
- package/src/avif/native/av1/tables/coefficient_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/coefficient_tables.js +82 -0
- package/src/avif/native/av1/tables/derived_block_tables.d.ts +15 -0
- package/src/avif/native/av1/tables/derived_block_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/derived_block_tables.js +23 -0
- package/src/avif/native/av1/tables/filter_tables.d.ts +171 -0
- package/src/avif/native/av1/tables/filter_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/filter_tables.js +313 -0
- package/src/avif/native/av1/tables/grain_tables.d.ts +11 -0
- package/src/avif/native/av1/tables/grain_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/grain_tables.js +190 -0
- package/src/avif/native/av1/tables/prediction_tables.d.ts +141 -0
- package/src/avif/native/av1/tables/prediction_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/prediction_tables.js +223 -0
- package/src/avif/native/av1/tables/quantizer_matrix_tables.d.ts +21 -0
- package/src/avif/native/av1/tables/quantizer_matrix_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/quantizer_matrix_tables.js +38 -0
- package/src/avif/native/av1/tables/quantizer_tables.d.ts +21 -0
- package/src/avif/native/av1/tables/quantizer_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/quantizer_tables.js +160 -0
- package/src/avif/native/av1/tables/scan_tables.d.ts +321 -0
- package/src/avif/native/av1/tables/scan_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/scan_tables.js +727 -0
- package/src/avif/native/av1/tables/segmentation_tables.d.ts +31 -0
- package/src/avif/native/av1/tables/segmentation_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/segmentation_tables.js +48 -0
- package/src/avif/native/av1/tables/transform_tables.d.ts +91 -0
- package/src/avif/native/av1/tables/transform_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/transform_tables.js +140 -0
- package/src/avif/native/av1/tables/unpack_table.d.ts +33 -0
- package/src/avif/native/av1/tables/unpack_table.d.ts.map +1 -0
- package/src/avif/native/av1/tables/unpack_table.js +73 -0
- package/src/avif/native/av1/transform/forward_transform_2d.d.ts +61 -0
- package/src/avif/native/av1/transform/forward_transform_2d.d.ts.map +1 -0
- package/src/avif/native/av1/transform/forward_transform_2d.js +574 -0
- package/src/avif/native/av1/transform/inverse_transform_1d.d.ts +76 -0
- package/src/avif/native/av1/transform/inverse_transform_1d.d.ts.map +1 -0
- package/src/avif/native/av1/transform/inverse_transform_1d.js +590 -0
- package/src/avif/native/av1/transform/inverse_transform_2d.d.ts +46 -0
- package/src/avif/native/av1/transform/inverse_transform_2d.d.ts.map +1 -0
- package/src/avif/native/av1/transform/inverse_transform_2d.js +180 -0
- package/src/avif/native/av1/util/ceil_log2.d.ts +13 -0
- package/src/avif/native/av1/util/ceil_log2.d.ts.map +1 -0
- package/src/avif/native/av1/util/ceil_log2.js +18 -0
- package/src/avif/native/av1/util/floor_log2.d.ts +20 -0
- package/src/avif/native/av1/util/floor_log2.d.ts.map +1 -0
- package/src/avif/native/av1/util/floor_log2.js +20 -0
- package/src/avif/native/av1/util/round2.d.ts +22 -0
- package/src/avif/native/av1/util/round2.d.ts.map +1 -0
- package/src/avif/native/av1/util/round2.js +27 -0
- package/src/avif/native/av1/util/round2_signed.d.ts +14 -0
- package/src/avif/native/av1/util/round2_signed.d.ts.map +1 -0
- package/src/avif/native/av1/util/round2_signed.js +17 -0
- package/src/avif/native/av1/util/tile_log2.d.ts +16 -0
- package/src/avif/native/av1/util/tile_log2.d.ts.map +1 -0
- package/src/avif/native/av1/util/tile_log2.js +23 -0
- package/src/avif/native/bitstream/BitReader.d.ts +174 -0
- package/src/avif/native/bitstream/BitReader.d.ts.map +1 -0
- package/src/avif/native/bitstream/BitReader.js +391 -0
- package/src/avif/native/bitstream/BitWriter.d.ts +122 -0
- package/src/avif/native/bitstream/BitWriter.d.ts.map +1 -0
- package/src/avif/native/bitstream/BitWriter.js +351 -0
- package/src/avif/native/color/ColourTransform.d.ts +62 -0
- package/src/avif/native/color/ColourTransform.d.ts.map +1 -0
- package/src/avif/native/color/ColourTransform.js +189 -0
- package/src/avif/native/color/YuvImage.d.ts +51 -0
- package/src/avif/native/color/YuvImage.d.ts.map +1 -0
- package/src/avif/native/color/YuvImage.js +66 -0
- package/src/avif/native/color/clamp_sample.d.ts +18 -0
- package/src/avif/native/color/clamp_sample.d.ts.map +1 -0
- package/src/avif/native/color/clamp_sample.js +25 -0
- package/src/avif/native/color/linear_to_transfer.d.ts +24 -0
- package/src/avif/native/color/linear_to_transfer.d.ts.map +1 -0
- package/src/avif/native/color/linear_to_transfer.js +126 -0
- package/src/avif/native/color/primaries.d.ts +20 -0
- package/src/avif/native/color/primaries.d.ts.map +1 -0
- package/src/avif/native/color/primaries.js +94 -0
- package/src/avif/native/color/rgb_row_to_ycbcr.d.ts +20 -0
- package/src/avif/native/color/rgb_row_to_ycbcr.d.ts.map +1 -0
- package/src/avif/native/color/rgb_row_to_ycbcr.js +78 -0
- package/src/avif/native/color/transfer_to_linear.d.ts +49 -0
- package/src/avif/native/color/transfer_to_linear.d.ts.map +1 -0
- package/src/avif/native/color/transfer_to_linear.js +171 -0
- package/src/avif/native/color/upsample_chroma_row.d.ts +35 -0
- package/src/avif/native/color/upsample_chroma_row.d.ts.map +1 -0
- package/src/avif/native/color/upsample_chroma_row.js +89 -0
- package/src/avif/native/color/ycbcr_row_to_rgb.d.ts +23 -0
- package/src/avif/native/color/ycbcr_row_to_rgb.d.ts.map +1 -0
- package/src/avif/native/color/ycbcr_row_to_rgb.js +78 -0
- package/src/avif/native/heif/AvifFile.d.ts +112 -0
- package/src/avif/native/heif/AvifFile.d.ts.map +1 -0
- package/src/avif/native/heif/AvifFile.js +142 -0
- package/src/avif/native/heif/ItemProperty.d.ts +244 -0
- package/src/avif/native/heif/ItemProperty.d.ts.map +1 -0
- package/src/avif/native/heif/ItemProperty.js +321 -0
- package/src/avif/native/heif/find_item_property.d.ts +17 -0
- package/src/avif/native/heif/find_item_property.d.ts.map +1 -0
- package/src/avif/native/heif/find_item_property.js +28 -0
- package/src/avif/native/heif/find_item_references.d.ts +16 -0
- package/src/avif/native/heif/find_item_references.d.ts.map +1 -0
- package/src/avif/native/heif/find_item_references.js +29 -0
- package/src/avif/native/heif/find_items_referencing.d.ts +17 -0
- package/src/avif/native/heif/find_items_referencing.d.ts.map +1 -0
- package/src/avif/native/heif/find_items_referencing.js +36 -0
- package/src/avif/native/heif/parse_avif_file.d.ts +15 -0
- package/src/avif/native/heif/parse_avif_file.d.ts.map +1 -0
- package/src/avif/native/heif/parse_avif_file.js +383 -0
- package/src/avif/native/heif/parse_image_grid.d.ts +18 -0
- package/src/avif/native/heif/parse_image_grid.d.ts.map +1 -0
- package/src/avif/native/heif/parse_image_grid.js +48 -0
- package/src/avif/native/heif/parse_item_property.d.ts +18 -0
- package/src/avif/native/heif/parse_item_property.d.ts.map +1 -0
- package/src/avif/native/heif/parse_item_property.js +243 -0
- package/src/avif/native/heif/read_item_data.d.ts +22 -0
- package/src/avif/native/heif/read_item_data.d.ts.map +1 -0
- package/src/avif/native/heif/read_item_data.js +97 -0
- package/src/avif/native/heif/write_avif_file.d.ts +50 -0
- package/src/avif/native/heif/write_avif_file.d.ts.map +1 -0
- package/src/avif/native/heif/write_avif_file.js +348 -0
- package/src/avif/native/heif/write_item_property.d.ts +16 -0
- package/src/avif/native/heif/write_item_property.d.ts.map +1 -0
- package/src/avif/native/heif/write_item_property.js +182 -0
- package/src/avif/native/index.d.ts +14 -0
- package/src/avif/native/index.d.ts.map +1 -0
- package/src/avif/native/index.js +56 -0
- package/src/avif/native/isobmff/BoxHeader.d.ts +50 -0
- package/src/avif/native/isobmff/BoxHeader.d.ts.map +1 -0
- package/src/avif/native/isobmff/BoxHeader.js +57 -0
- package/src/avif/native/isobmff/BoxWriter.d.ts +118 -0
- package/src/avif/native/isobmff/BoxWriter.d.ts.map +1 -0
- package/src/avif/native/isobmff/BoxWriter.js +264 -0
- package/src/avif/native/isobmff/ByteCursor.d.ts +125 -0
- package/src/avif/native/isobmff/ByteCursor.d.ts.map +1 -0
- package/src/avif/native/isobmff/ByteCursor.js +298 -0
- package/src/avif/native/isobmff/for_each_box.d.ts +23 -0
- package/src/avif/native/isobmff/for_each_box.d.ts.map +1 -0
- package/src/avif/native/isobmff/for_each_box.js +39 -0
- package/src/avif/native/isobmff/read_box_header.d.ts +22 -0
- package/src/avif/native/isobmff/read_box_header.d.ts.map +1 -0
- package/src/avif/native/isobmff/read_box_header.js +59 -0
- package/src/avif/native/isobmff/read_full_box_header.d.ts +26 -0
- package/src/avif/native/isobmff/read_full_box_header.d.ts.map +1 -0
- package/src/avif/native/isobmff/read_full_box_header.js +33 -0
- package/src/avif/threaded_image_encoder.d.ts +7 -2
- package/src/avif/threaded_image_encoder.d.ts.map +1 -1
- package/src/avif/threaded_image_encoder.js +107 -21
- package/src/core/binary/BinaryBuffer.d.ts +40 -0
- package/src/core/binary/BinaryBuffer.d.ts.map +1 -1
- package/src/core/binary/BinaryBuffer.js +100 -0
- package/src/core/binary/hash/crc32.d.ts +16 -0
- package/src/core/binary/hash/crc32.d.ts.map +1 -0
- package/src/core/binary/hash/crc32.js +96 -0
- package/src/core/binary/utf8/utf8_decode.d.ts +21 -0
- package/src/core/binary/utf8/utf8_decode.d.ts.map +1 -0
- package/src/core/binary/utf8/utf8_decode.js +43 -0
- package/src/core/binary/utf8/utf8_encode_into.d.ts +20 -0
- package/src/core/binary/utf8/utf8_encode_into.d.ts.map +1 -0
- package/src/core/binary/utf8/utf8_encode_into.js +48 -0
- package/src/core/binary/utf8/utf8_encoded_length.d.ts +14 -0
- package/src/core/binary/utf8/utf8_encoded_length.d.ts.map +1 -0
- package/src/core/binary/utf8/utf8_encoded_length.js +36 -0
- package/src/core/color/COLOR_FIX_PLAN_2026_08_28.md +417 -0
- package/src/core/color/COLOR_REVIEW_2026_08_28.md +779 -0
- package/src/core/color/Color.d.ts +128 -20
- package/src/core/color/Color.d.ts.map +1 -1
- package/src/core/color/Color.js +959 -866
- package/src/core/color/PQ/PQ_constants.d.ts +10 -0
- package/src/core/color/PQ/PQ_constants.d.ts.map +1 -1
- package/src/core/color/PQ/PQ_constants.js +10 -0
- package/src/core/color/PQ/linear_to_PQ.d.ts.map +1 -1
- package/src/core/color/PQ/linear_to_PQ.js +6 -0
- package/src/core/color/REC709_PRIMARIES.d.ts +50 -0
- package/src/core/color/REC709_PRIMARIES.d.ts.map +1 -0
- package/src/core/color/REC709_PRIMARIES.js +53 -0
- package/src/core/color/construct/color_from_hex.d.ts +21 -0
- package/src/core/color/construct/color_from_hex.d.ts.map +1 -0
- package/src/core/color/construct/color_from_hex.js +33 -0
- package/src/core/color/construct/color_from_temperature.d.ts +22 -0
- package/src/core/color/construct/color_from_temperature.d.ts.map +1 -0
- package/src/core/color/construct/color_from_temperature.js +33 -0
- package/src/core/color/construct/color_from_uint24.d.ts +19 -0
- package/src/core/color/construct/color_from_uint24.d.ts.map +1 -0
- package/src/core/color/construct/color_from_uint24.js +26 -0
- package/src/core/color/construct/color_from_uint32.d.ts +20 -0
- package/src/core/color/construct/color_from_uint32.d.ts.map +1 -0
- package/src/core/color/construct/color_from_uint32.js +39 -0
- package/src/core/color/construct/color_gray.d.ts +17 -0
- package/src/core/color/construct/color_gray.d.ts.map +1 -0
- package/src/core/color/construct/color_gray.js +22 -0
- package/src/core/color/hex/hex2rgb.d.ts +1 -11
- package/src/core/color/hex/hex2rgb.d.ts.map +1 -1
- package/src/core/color/hex/hex2rgb.js +7 -24
- package/src/core/color/hex/hex_to_rgb.d.ts +18 -0
- package/src/core/color/hex/hex_to_rgb.d.ts.map +1 -0
- package/src/core/color/hex/hex_to_rgb.js +62 -0
- package/src/core/color/hex/rgb2hex.d.ts +1 -8
- package/src/core/color/hex/rgb2hex.d.ts.map +1 -1
- package/src/core/color/hex/rgb2hex.js +7 -13
- package/src/core/color/hex/rgb_to_hex.d.ts +9 -0
- package/src/core/color/hex/rgb_to_hex.d.ts.map +1 -0
- package/src/core/color/hex/rgb_to_hex.js +13 -0
- package/src/core/color/hex/rgba_to_hex.d.ts +19 -0
- package/src/core/color/hex/rgba_to_hex.d.ts.map +1 -0
- package/src/core/color/hex/rgba_to_hex.js +23 -0
- package/src/core/color/hsv/hsv2rgb.d.ts +1 -12
- package/src/core/color/hsv/hsv2rgb.d.ts.map +1 -1
- package/src/core/color/hsv/hsv2rgb.js +8 -21
- package/src/core/color/hsv/hsv2rgb_float.d.ts +1 -12
- package/src/core/color/hsv/hsv2rgb_float.d.ts.map +1 -1
- package/src/core/color/hsv/hsv2rgb_float.js +8 -56
- package/src/core/color/hsv/hsv_to_rgb.d.ts +13 -0
- package/src/core/color/hsv/hsv_to_rgb.d.ts.map +1 -0
- package/src/core/color/hsv/hsv_to_rgb.js +39 -0
- package/src/core/color/hsv/hsv_to_rgb_uint8.d.ts +13 -0
- package/src/core/color/hsv/hsv_to_rgb_uint8.d.ts.map +1 -0
- package/src/core/color/hsv/hsv_to_rgb_uint8.js +21 -0
- package/src/core/color/hsv/hue_to_rgb_sextant.d.ts +24 -0
- package/src/core/color/hsv/hue_to_rgb_sextant.d.ts.map +1 -0
- package/src/core/color/hsv/hue_to_rgb_sextant.js +67 -0
- package/src/core/color/hsv/rgb2hsv.d.ts +1 -12
- package/src/core/color/hsv/rgb2hsv.d.ts.map +1 -1
- package/src/core/color/hsv/rgb2hsv.js +7 -42
- package/src/core/color/hsv/rgb_to_hsv.d.ts +13 -0
- package/src/core/color/hsv/rgb_to_hsv.d.ts.map +1 -0
- package/src/core/color/hsv/rgb_to_hsv.js +42 -0
- package/src/core/color/hunt/hpe_to_xyz.d.ts +2 -0
- package/src/core/color/hunt/hpe_to_xyz.d.ts.map +1 -0
- package/src/core/color/hunt/hpe_to_xyz.js +4 -0
- package/src/core/color/hunt/xyz_to_hpe.d.ts +1 -6
- package/src/core/color/hunt/xyz_to_hpe.d.ts.map +1 -1
- package/src/core/color/hunt/xyz_to_hpe.js +12 -15
- package/src/core/color/illuminant/D65_spd_tabulated.d.ts.map +1 -1
- package/src/core/color/illuminant/D65_spd_tabulated.js +107 -104
- package/src/core/color/int2rgb.d.ts +1 -10
- package/src/core/color/int2rgb.d.ts.map +1 -1
- package/src/core/color/int2rgb.js +7 -12
- package/src/core/color/int_to_rgb.d.ts +21 -0
- package/src/core/color/int_to_rgb.d.ts.map +1 -0
- package/src/core/color/int_to_rgb.js +33 -0
- package/src/core/color/kelvin/kelvin_to_rgb.d.ts.map +1 -1
- package/src/core/color/kelvin/kelvin_to_rgb.js +22 -2
- package/src/core/color/kelvin/rgb_to_kelvin.d.ts +22 -2
- package/src/core/color/kelvin/rgb_to_kelvin.d.ts.map +1 -1
- package/src/core/color/kelvin/rgb_to_kelvin.js +22 -2
- package/src/core/color/lab/lab_to_xyz.d.ts +20 -0
- package/src/core/color/lab/lab_to_xyz.d.ts.map +1 -0
- package/src/core/color/lab/lab_to_xyz.js +69 -0
- package/src/core/color/oklab/gamut_clip_adaptive_l0.d.ts +34 -0
- package/src/core/color/oklab/gamut_clip_adaptive_l0.d.ts.map +1 -0
- package/src/core/color/oklab/gamut_clip_adaptive_l0.js +46 -0
- package/src/core/color/oklab/gamut_clip_at_l0.d.ts +33 -0
- package/src/core/color/oklab/gamut_clip_at_l0.d.ts.map +1 -0
- package/src/core/color/oklab/gamut_clip_at_l0.js +84 -0
- package/src/core/color/oklab/gamut_clip_preserve_chroma.d.ts +24 -0
- package/src/core/color/oklab/gamut_clip_preserve_chroma.d.ts.map +1 -0
- package/src/core/color/oklab/gamut_clip_preserve_chroma.js +37 -0
- package/src/core/color/oklab/gamut_clip_project_to_lcusp.d.ts +23 -0
- package/src/core/color/oklab/gamut_clip_project_to_lcusp.d.ts.map +1 -0
- package/src/core/color/oklab/gamut_clip_project_to_lcusp.js +46 -0
- package/src/core/color/oklab/linear_srgb_to_okhsl.d.ts +19 -0
- package/src/core/color/oklab/linear_srgb_to_okhsl.d.ts.map +1 -0
- package/src/core/color/oklab/linear_srgb_to_okhsl.js +93 -0
- package/src/core/color/oklab/linear_srgb_to_okhsv.d.ts +12 -4
- package/src/core/color/oklab/linear_srgb_to_okhsv.d.ts.map +1 -1
- package/src/core/color/oklab/linear_srgb_to_okhsv.js +108 -84
- package/src/core/color/oklab/linear_srgb_to_oklab.d.ts +13 -4
- package/src/core/color/oklab/linear_srgb_to_oklab.d.ts.map +1 -1
- package/src/core/color/oklab/linear_srgb_to_oklab.js +28 -19
- package/src/core/color/oklab/okhsl_chroma_bounds.d.ts +51 -0
- package/src/core/color/oklab/okhsl_chroma_bounds.d.ts.map +1 -0
- package/src/core/color/oklab/okhsl_chroma_bounds.js +128 -0
- package/src/core/color/oklab/okhsl_to_linear_srgb.d.ts +19 -0
- package/src/core/color/oklab/okhsl_to_linear_srgb.d.ts.map +1 -0
- package/src/core/color/oklab/okhsl_to_linear_srgb.js +85 -0
- package/src/core/color/oklab/oklab_to_oklch.d.ts +24 -0
- package/src/core/color/oklab/oklab_to_oklch.d.ts.map +1 -0
- package/src/core/color/oklab/oklab_to_oklch.js +35 -0
- package/src/core/color/oklab/oklch_to_oklab.d.ts +18 -0
- package/src/core/color/oklab/oklch_to_oklab.d.ts.map +1 -0
- package/src/core/color/oklab/oklch_to_oklab.js +26 -0
- package/src/core/color/oklab/toe.d.ts +12 -0
- package/src/core/color/oklab/toe.d.ts.map +1 -1
- package/src/core/color/oklab/toe.js +34 -22
- package/src/core/color/operations/color_add.d.ts +21 -0
- package/src/core/color/operations/color_add.d.ts.map +1 -0
- package/src/core/color/operations/color_add.js +23 -0
- package/src/core/color/operations/color_add_scaled.d.ts +20 -0
- package/src/core/color/operations/color_add_scaled.d.ts.map +1 -0
- package/src/core/color/operations/color_add_scaled.js +30 -0
- package/src/core/color/operations/color_clamp.d.ts +22 -0
- package/src/core/color/operations/color_clamp.d.ts.map +1 -0
- package/src/core/color/operations/color_clamp.js +25 -0
- package/src/core/color/operations/color_darken.d.ts +2 -1
- package/src/core/color/operations/color_darken.d.ts.map +1 -1
- package/src/core/color/operations/color_darken.js +25 -24
- package/src/core/color/operations/color_desaturate.d.ts +2 -1
- package/src/core/color/operations/color_desaturate.d.ts.map +1 -1
- package/src/core/color/operations/color_desaturate.js +25 -24
- package/src/core/color/operations/color_get_hsl.d.ts +18 -0
- package/src/core/color/operations/color_get_hsl.d.ts.map +1 -0
- package/src/core/color/operations/color_get_hsl.js +60 -0
- package/src/core/color/operations/color_is_in_gamut.d.ts +20 -0
- package/src/core/color/operations/color_is_in_gamut.d.ts.map +1 -0
- package/src/core/color/operations/color_is_in_gamut.js +30 -0
- package/src/core/color/operations/color_lerp.d.ts +12 -3
- package/src/core/color/operations/color_lerp.d.ts.map +1 -1
- package/src/core/color/operations/color_lerp.js +55 -46
- package/src/core/color/operations/color_lighten.d.ts +9 -5
- package/src/core/color/operations/color_lighten.d.ts.map +1 -1
- package/src/core/color/operations/color_lighten.js +29 -24
- package/src/core/color/operations/color_mix_okhsv_channel.d.ts +24 -0
- package/src/core/color/operations/color_mix_okhsv_channel.d.ts.map +1 -0
- package/src/core/color/operations/color_mix_okhsv_channel.js +48 -0
- package/src/core/color/operations/color_multiply_rgb.d.ts +21 -0
- package/src/core/color/operations/color_multiply_rgb.d.ts.map +1 -0
- package/src/core/color/operations/color_multiply_rgb.js +26 -0
- package/src/core/color/operations/color_saturate.d.ts +9 -5
- package/src/core/color/operations/color_saturate.d.ts.map +1 -1
- package/src/core/color/operations/color_saturate.js +29 -24
- package/src/core/color/operations/color_scale_okhsv_channel.d.ts +1 -1
- package/src/core/color/operations/color_scale_okhsv_channel.d.ts.map +1 -1
- package/src/core/color/operations/color_scale_okhsv_channel.js +58 -45
- package/src/core/color/operations/color_srgb_apply.d.ts +28 -0
- package/src/core/color/operations/color_srgb_apply.d.ts.map +1 -0
- package/src/core/color/operations/color_srgb_apply.js +40 -0
- package/src/core/color/operations/color_sub.d.ts +16 -0
- package/src/core/color/operations/color_sub.d.ts.map +1 -0
- package/src/core/color/operations/color_sub.js +18 -0
- package/src/core/color/parse_color.d.ts +10 -1
- package/src/core/color/parse_color.d.ts.map +1 -1
- package/src/core/color/parse_color.js +100 -84
- package/src/core/color/parse_color_normalized.d.ts +24 -0
- package/src/core/color/parse_color_normalized.d.ts.map +1 -0
- package/src/core/color/parse_color_normalized.js +38 -0
- package/src/core/color/rgb2uint24.d.ts +1 -8
- package/src/core/color/rgb2uint24.d.ts.map +1 -1
- package/src/core/color/rgb2uint24.js +7 -20
- package/src/core/color/rgb2uint32.d.ts +1 -9
- package/src/core/color/rgb2uint32.d.ts.map +1 -1
- package/src/core/color/rgb2uint32.js +7 -18
- package/src/core/color/rgb_to_luminance.d.ts +14 -5
- package/src/core/color/rgb_to_luminance.d.ts.map +1 -1
- package/src/core/color/rgb_to_luminance.js +24 -13
- package/src/core/color/rgb_to_uint24.d.ts +9 -0
- package/src/core/color/rgb_to_uint24.d.ts.map +1 -0
- package/src/core/color/rgb_to_uint24.js +20 -0
- package/src/core/color/rgb_to_uint32.d.ts +10 -0
- package/src/core/color/rgb_to_uint32.d.ts.map +1 -0
- package/src/core/color/rgb_to_uint32.js +21 -0
- package/src/core/color/sRGB/linear_to_sRGB.d.ts +7 -0
- package/src/core/color/sRGB/linear_to_sRGB.d.ts.map +1 -1
- package/src/core/color/sRGB/linear_to_sRGB.js +39 -32
- package/src/core/color/xyz/hpe_to_xyz.d.ts +24 -0
- package/src/core/color/xyz/hpe_to_xyz.d.ts.map +1 -0
- package/src/core/color/xyz/hpe_to_xyz.js +39 -0
- package/src/core/color/xyz/rgb_to_xyz.d.ts +17 -2
- package/src/core/color/xyz/rgb_to_xyz.d.ts.map +1 -1
- package/src/core/color/xyz/rgb_to_xyz.js +44 -18
- package/src/core/color/xyz/xyz_cmf_tabulated.d.ts.map +1 -1
- package/src/core/color/xyz/xyz_cmf_tabulated.js +217 -211
- package/src/core/color/xyz/xyz_cmf_wyman.d.ts +4 -0
- package/src/core/color/xyz/xyz_cmf_wyman.d.ts.map +1 -1
- package/src/core/color/xyz/xyz_cmf_wyman.js +74 -65
- package/src/core/color/xyz/xyz_to_hpe.d.ts +18 -0
- package/src/core/color/xyz/xyz_to_hpe.d.ts.map +1 -0
- package/src/core/color/xyz/xyz_to_hpe.js +33 -0
- package/src/core/color/xyz/xyz_to_rgb.d.ts +17 -2
- package/src/core/color/xyz/xyz_to_rgb.d.ts.map +1 -1
- package/src/core/color/xyz/xyz_to_rgb.js +39 -16
- package/src/core/color/ycxcz/xyz_to_ycxcz.d.ts +7 -2
- package/src/core/color/ycxcz/xyz_to_ycxcz.d.ts.map +1 -1
- package/src/core/color/ycxcz/xyz_to_ycxcz.js +33 -28
- package/src/core/events/signal/Signal.js +820 -820
- package/src/core/geom/3d/shape/ConvexHullShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/ConvexHullShape3D.js +28 -4
- package/src/core/math/clamp_index.d.ts +18 -0
- package/src/core/math/clamp_index.d.ts.map +1 -0
- package/src/core/math/clamp_index.js +23 -0
- package/src/engine/asset/loaders/image/IMAGE_CODEC_REVIEW_2026_08_28.md +803 -0
- package/src/engine/asset/loaders/image/jpeg/JpegFrame.d.ts +5 -3
- package/src/engine/asset/loaders/image/jpeg/JpegFrame.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/jpeg/JpegFrame.js +5 -3
- package/src/engine/asset/loaders/image/jpeg/JpegFrameComponent.d.ts +2 -1
- package/src/engine/asset/loaders/image/jpeg/JpegFrameComponent.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/jpeg/JpegFrameComponent.js +2 -1
- package/src/engine/asset/loaders/image/jpeg/JpegImage.d.ts +17 -0
- package/src/engine/asset/loaders/image/jpeg/JpegImage.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/jpeg/JpegImage.js +197 -157
- package/src/engine/asset/loaders/image/jpeg/idct8x8_float.d.ts +0 -1
- package/src/engine/asset/loaders/image/jpeg/idct8x8_float.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/jpeg/idct8x8_float.js +0 -1
- package/src/engine/asset/loaders/image/jpeg/jpeg_component_row.d.ts +28 -0
- package/src/engine/asset/loaders/image/jpeg/jpeg_component_row.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/jpeg/jpeg_component_row.js +31 -0
- package/src/engine/asset/loaders/image/png/PNG.d.ts +3 -18
- package/src/engine/asset/loaders/image/png/PNG.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/PNG.js +3 -139
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts +16 -16
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/PNGReader.js +143 -160
- package/src/engine/asset/loaders/image/png/chunk/png_chunk_decode_iTXt.js +3 -3
- package/src/engine/asset/loaders/image/png/chunk/png_chunk_decode_zTXt.js +3 -3
- package/src/engine/asset/loaders/image/png/crc32.d.ts +1 -15
- package/src/engine/asset/loaders/image/png/crc32.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/crc32.js +5 -89
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.d.ts +12 -10
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.js +20 -45
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterSub.d.ts +2 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterSub.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterSub.js +2 -0
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterUp.d.ts +2 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterUp.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterUp.js +2 -0
- package/src/engine/asset/loaders/image/png/filter/png_unfilter.d.ts +22 -0
- package/src/engine/asset/loaders/image/png/filter/png_unfilter.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/png/filter/png_unfilter.js +68 -0
- package/src/engine/asset/loaders/image/png/png_inflate.d.ts +20 -0
- package/src/engine/asset/loaders/image/png/png_inflate.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/png/png_inflate.js +85 -0
- package/src/engine/asset/loaders/image/png/png_unpack_samples.d.ts +22 -0
- package/src/engine/asset/loaders/image/png/png_unpack_samples.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/png/png_unpack_samples.js +38 -0
- package/src/engine/graphics/ecs/sprite/SpriteSystemPE.d.ts.map +1 -1
- package/src/engine/graphics/ecs/sprite/SpriteSystemPE.js +135 -132
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts +16 -3
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +1157 -1149
- package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts +26 -0
- package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/FrameGraph.js +947 -900
- package/src/engine/physics/ecs/PhysicsSystem.d.ts +69 -81
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/PhysicsSystem.js +83 -77
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/shade/device/IMMEDIATE_DATA_PLAN_2026_08_28.md +451 -0
- package/src/shade/device/ShadeGPUCommandContext.d.ts +21 -0
- package/src/shade/device/ShadeGPUCommandContext.d.ts.map +1 -1
- package/src/shade/device/ShadeGPUCommandContext.js +940 -749
- package/src/shade/device/timing/GPUTimerArray.d.ts +22 -4
- package/src/shade/device/timing/GPUTimerArray.d.ts.map +1 -1
- package/src/shade/device/timing/GPUTimerArray.js +88 -14
- package/src/shade/device/timing/GPU_PROFILER_PROPOSAL_2026_08_28.md +876 -0
- package/src/shade/device/timing/profile/GPUFrameRecorder.d.ts +93 -0
- package/src/shade/device/timing/profile/GPUFrameRecorder.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUFrameRecorder.js +297 -0
- package/src/shade/device/timing/profile/GPUProfileCapture.d.ts +62 -0
- package/src/shade/device/timing/profile/GPUProfileCapture.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileCapture.js +77 -0
- package/src/shade/device/timing/profile/GPUProfileFrame.d.ts +73 -0
- package/src/shade/device/timing/profile/GPUProfileFrame.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileFrame.js +88 -0
- package/src/shade/device/timing/profile/GPUProfileLevel.d.ts +20 -0
- package/src/shade/device/timing/profile/GPUProfileLevel.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileLevel.js +50 -0
- package/src/shade/device/timing/profile/GPUProfileMeta.d.ts +63 -0
- package/src/shade/device/timing/profile/GPUProfileMeta.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileMeta.js +73 -0
- package/src/shade/device/timing/profile/GPUProfileSession.d.ts +173 -0
- package/src/shade/device/timing/profile/GPUProfileSession.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileSession.js +470 -0
- package/src/shade/device/timing/profile/GPUProfileSpan.d.ts +60 -0
- package/src/shade/device/timing/profile/GPUProfileSpan.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileSpan.js +65 -0
- package/src/shade/device/timing/profile/GPUProfileSpanKind.d.ts +19 -0
- package/src/shade/device/timing/profile/GPUProfileSpanKind.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileSpanKind.js +25 -0
- package/src/shade/device/timing/profile/GPUProfileTopology.d.ts +159 -0
- package/src/shade/device/timing/profile/GPUProfileTopology.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileTopology.js +202 -0
- package/src/shade/device/timing/profile/GPUProfileWork.d.ts +90 -0
- package/src/shade/device/timing/profile/GPUProfileWork.d.ts.map +1 -0
- package/src/shade/device/timing/profile/GPUProfileWork.js +115 -0
- package/src/shade/device/timing/profile/SGPTDefect.d.ts +43 -0
- package/src/shade/device/timing/profile/SGPTDefect.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPTDefect.js +65 -0
- package/src/shade/device/timing/profile/SGPTHeader.d.ts +38 -0
- package/src/shade/device/timing/profile/SGPTHeader.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPTHeader.js +46 -0
- package/src/shade/device/timing/profile/SGPTRecordRef.d.ts +37 -0
- package/src/shade/device/timing/profile/SGPTRecordRef.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPTRecordRef.js +45 -0
- package/src/shade/device/timing/profile/SGPTWriteStream.d.ts +103 -0
- package/src/shade/device/timing/profile/SGPTWriteStream.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPTWriteStream.js +287 -0
- package/src/shade/device/timing/profile/SGPT_DEFECT.d.ts +19 -0
- package/src/shade/device/timing/profile/SGPT_DEFECT.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_DEFECT.js +26 -0
- package/src/shade/device/timing/profile/SGPT_FLAG.d.ts +8 -0
- package/src/shade/device/timing/profile/SGPT_FLAG.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_FLAG.js +15 -0
- package/src/shade/device/timing/profile/SGPT_FORMAT.md +345 -0
- package/src/shade/device/timing/profile/SGPT_FORMAT_VERSION.d.ts +10 -0
- package/src/shade/device/timing/profile/SGPT_FORMAT_VERSION.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_FORMAT_VERSION.js +9 -0
- package/src/shade/device/timing/profile/SGPT_FRAME_SLACK.d.ts +17 -0
- package/src/shade/device/timing/profile/SGPT_FRAME_SLACK.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_FRAME_SLACK.js +16 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_CHECKSUM_COVERAGE.d.ts +16 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_CHECKSUM_COVERAGE.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_CHECKSUM_COVERAGE.js +15 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_OFFSET.d.ts +15 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_OFFSET.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_OFFSET.js +29 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_SIZE.d.ts +7 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_SIZE.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_HEADER_SIZE.js +6 -0
- package/src/shade/device/timing/profile/SGPT_MAGIC.d.ts +7 -0
- package/src/shade/device/timing/profile/SGPT_MAGIC.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_MAGIC.js +6 -0
- package/src/shade/device/timing/profile/SGPT_MIN_READER_VERSION.d.ts +16 -0
- package/src/shade/device/timing/profile/SGPT_MIN_READER_VERSION.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_MIN_READER_VERSION.js +15 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_HEADER_SIZE.d.ts +7 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_HEADER_SIZE.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_HEADER_SIZE.js +6 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_OFFSET.d.ts +13 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_OFFSET.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_OFFSET.js +23 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_SYNC.d.ts +12 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_SYNC.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_SYNC.js +11 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_TYPE.d.ts +18 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_TYPE.d.ts.map +1 -0
- package/src/shade/device/timing/profile/SGPT_RECORD_TYPE.js +46 -0
- package/src/shade/device/timing/profile/frame_graph_extract_topology.d.ts +20 -0
- package/src/shade/device/timing/profile/frame_graph_extract_topology.d.ts.map +1 -0
- package/src/shade/device/timing/profile/frame_graph_extract_topology.js +174 -0
- package/src/shade/device/timing/profile/make_profiling_pass_encoder.d.ts +21 -0
- package/src/shade/device/timing/profile/make_profiling_pass_encoder.d.ts.map +1 -0
- package/src/shade/device/timing/profile/make_profiling_pass_encoder.js +114 -0
- package/src/shade/device/timing/profile/parse_workgroup_size.d.ts +20 -0
- package/src/shade/device/timing/profile/parse_workgroup_size.d.ts.map +1 -0
- package/src/shade/device/timing/profile/parse_workgroup_size.js +43 -0
- package/src/shade/device/timing/profile/sgpt_fourcc.d.ts +18 -0
- package/src/shade/device/timing/profile/sgpt_fourcc.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_fourcc.js +34 -0
- package/src/shade/device/timing/profile/sgpt_frame_codec.d.ts +42 -0
- package/src/shade/device/timing/profile/sgpt_frame_codec.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_frame_codec.js +172 -0
- package/src/shade/device/timing/profile/sgpt_meta_codec.d.ts +20 -0
- package/src/shade/device/timing/profile/sgpt_meta_codec.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_meta_codec.js +65 -0
- package/src/shade/device/timing/profile/sgpt_read_capture.d.ts +19 -0
- package/src/shade/device/timing/profile/sgpt_read_capture.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_read_capture.js +134 -0
- package/src/shade/device/timing/profile/sgpt_read_header.d.ts +22 -0
- package/src/shade/device/timing/profile/sgpt_read_header.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_read_header.js +94 -0
- package/src/shade/device/timing/profile/sgpt_read_records.d.ts +27 -0
- package/src/shade/device/timing/profile/sgpt_read_records.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_read_records.js +153 -0
- package/src/shade/device/timing/profile/sgpt_topology_codec.d.ts +54 -0
- package/src/shade/device/timing/profile/sgpt_topology_codec.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_topology_codec.js +329 -0
- package/src/shade/device/timing/profile/sgpt_write_header.d.ts +22 -0
- package/src/shade/device/timing/profile/sgpt_write_header.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_write_header.js +47 -0
- package/src/shade/device/timing/profile/sgpt_write_record.d.ts +23 -0
- package/src/shade/device/timing/profile/sgpt_write_record.d.ts.map +1 -0
- package/src/shade/device/timing/profile/sgpt_write_record.js +62 -0
- package/src/shade/renderer/Renderer.d.ts +21 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +2513 -2455
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/scene/serialization/decode_image_source_hdr.d.ts +14 -3
- package/src/shade/renderer/scene/serialization/decode_image_source_hdr.d.ts.map +1 -1
- package/src/shade/renderer/scene/serialization/decode_image_source_hdr.js +50 -51
- package/src/shade/renderer/scene/serialization/deserialize_scene.d.ts.map +1 -1
- package/src/shade/renderer/scene/serialization/deserialize_scene.js +531 -521
- package/src/shade/renderer/scene/serialization/write_image_source.d.ts.map +1 -1
- package/src/shade/renderer/scene/serialization/write_image_source.js +6 -4
- package/src/shade/renderer/shader/chunk/color/chunk_rgb_to_luminance.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/chunk_rgb_to_luminance.js +34 -32
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.d.ts +31 -0
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.js +62 -31
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_inverse_eotf_st2084.d.ts +10 -0
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_inverse_eotf_st2084.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_inverse_eotf_st2084.js +32 -22
- package/src/shade/renderer/shader/chunk/color/sRGB/chunk_sRGBTransferOETF.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/sRGB/chunk_sRGBTransferOETF.js +22 -21
- package/src/shade/renderer/shader/chunk/color/tonemap/gt7/chunk_tonemap_gt7.d.ts +6 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/gt7/chunk_tonemap_gt7.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/tonemap/gt7/chunk_tonemap_gt7.js +110 -104
- package/src/shade/renderer/shader/chunk/color/xyz/chunk_rgb_to_xyz.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/xyz/chunk_rgb_to_xyz.js +23 -21
- package/src/view/elements/ColorPickerView.js +296 -296
- package/src/avif/codec/dec/Readme.md +0 -14
- package/src/avif/codec/dec/avif_dec.cpp +0 -234
- package/src/avif/codec/dec/avif_dec.d.ts +0 -3
- package/src/avif/codec/dec/avif_dec.d.ts.map +0 -1
- package/src/avif/codec/dec/avif_dec.js +0 -16
- package/src/avif/codec/dec/avif_dec.wasm +0 -0
- package/src/avif/codec/enc/README.md +0 -37
- package/src/avif/codec/enc/avif_enc.cpp +0 -216
- package/src/avif/codec/enc/avif_enc.d.ts +0 -3
- package/src/avif/codec/enc/avif_enc.d.ts.map +0 -1
- package/src/avif/codec/enc/avif_enc.js +0 -6144
- package/src/avif/codec/enc/avif_enc.wasm +0 -0
- package/src/avif/codec/enc/avif_enc_mt.d.ts +0 -3
- package/src/avif/codec/enc/avif_enc_mt.d.ts.map +0 -1
- package/src/avif/codec/enc/avif_enc_mt.js +0 -6811
- package/src/avif/codec/enc/avif_enc_mt.wasm +0 -0
- package/src/avif/codec/enc/avif_enc_mt.worker.d.mts +0 -2
- package/src/avif/codec/enc/avif_enc_mt.worker.d.mts.map +0 -1
- package/src/avif/codec/enc/avif_enc_mt.worker.d.ts +0 -11
- package/src/avif/codec/enc/avif_enc_mt.worker.d.ts.map +0 -1
- package/src/avif/codec/enc/avif_enc_mt.worker.js +0 -171
- package/src/avif/codec/enc/avif_enc_mt.worker.mjs +0 -1
- package/src/avif/decode.d.ts +0 -3
- package/src/avif/decode.d.ts.map +0 -1
- package/src/avif/decode.js +0 -42
- package/src/avif/encode.d.ts +0 -3
- package/src/avif/encode.d.ts.map +0 -1
- package/src/avif/encode.js +0 -75
- package/src/avif/meta.d.ts +0 -24
- package/src/avif/meta.d.ts.map +0 -1
- package/src/avif/meta.js +0 -23
- package/src/avif/tsconfig.tsbuildinfo +0 -1
- package/src/avif/utils.d.ts +0 -17
- package/src/avif/utils.d.ts.map +0 -1
- package/src/avif/utils.js +0 -31
- package/src/engine/asset/loaders/image/jpeg/idct8x8_fixed.d.ts +0 -23
- package/src/engine/asset/loaders/image/jpeg/idct8x8_fixed.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/jpeg/idct8x8_fixed.js +0 -214
- package/src/engine/asset/loaders/image/png/inflate.d.ts +0 -7
- package/src/engine/asset/loaders/image/png/inflate.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/inflate.js +0 -20
- package/src/engine/save/GameStateLoader.d.ts +0 -49
- package/src/engine/save/GameStateLoader.d.ts.map +0 -1
- package/src/engine/save/GameStateLoader.js +0 -168
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
# WGSL immediate data in Shade — landing plan, 2026-08-28
|
|
2
|
+
|
|
3
|
+
How to bring the WGSL `immediate` address space (`var<immediate>` + `GPUBindingCommandsMixin.setImmediates`)
|
|
4
|
+
into Shade, starting from `ShadeGPUCommandContext.allocateTransientBuffer` and the call sites that
|
|
5
|
+
feed it.
|
|
6
|
+
|
|
7
|
+
**Verdict:** worth landing. Shade already models this exact concept, under this exact name, on top of
|
|
8
|
+
uniform buffers — nineteen of the twenty structs literally called `PUSH_CONSTANTS` fit inside the
|
|
9
|
+
64-byte budget unmodified. With no fallback in scope the remaining work is small and almost entirely
|
|
10
|
+
additive.
|
|
11
|
+
|
|
12
|
+
> **Scope decision (rev 2).** An earlier revision of this plan carried a dual-lowering fallback:
|
|
13
|
+
> `var<immediate>` where supported, `@group(N) @binding(0) var<uniform>` where not, chosen by a
|
|
14
|
+
> capability probe. That is now **out of scope**, and it should never have been in it —
|
|
15
|
+
> [`RENDERER_CONTRACT.md` §2](../RENDERER_CONTRACT.md) already states the rule it violated: *"Shade
|
|
16
|
+
> requires a WebGPU device that meets a fixed floor. There is no feature detection beyond it and no
|
|
17
|
+
> branch that produces a lesser frame."* `ShadeDeviceFailureReason` says the same thing in its header
|
|
18
|
+
> comment, citing D6/I-8: no degradation tiers, no fallbacks, no feature-detection branches.
|
|
19
|
+
>
|
|
20
|
+
> Immediates therefore join the floor rather than getting a compatibility path. That deletes: the
|
|
21
|
+
> import-time capability probe and its unrecoverable failure mode, the extra bind group the fallback
|
|
22
|
+
> lowering needed, the resulting exclusion of the 7 shaders already at `maxBindGroups: 4`, and the
|
|
23
|
+
> `vi.resetModules()` dance every dual-lowering spec would have required. If a fallback is ever
|
|
24
|
+
> genuinely wanted, §9 shows why it belongs in a shader variant rather than in the binding machinery.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 1. What the feature is, restricted to what matters here
|
|
29
|
+
|
|
30
|
+
Immediates are WebGPU's portable spelling of Vulkan push constants / D3D12 root constants / Metal
|
|
31
|
+
`setBytes`. The parts that constrain this plan:
|
|
32
|
+
|
|
33
|
+
| | Value |
|
|
34
|
+
|---|---|
|
|
35
|
+
| WGSL gate | `requires immediate_address_space;` — a **language extension**, not a `GPUFeatureName` |
|
|
36
|
+
| Detection | `navigator.gpu.wgslLanguageFeatures.has('immediate_address_space')` — synchronous, no adapter needed |
|
|
37
|
+
| Size budget | `maxImmediateSize`, default **64 bytes**, multiple of 4, **no separate Compatibility Mode default** |
|
|
38
|
+
| Declaration | Module scope, immutable, **no `@group` / `@binding`** |
|
|
39
|
+
| Store type | Host-shareable constructible, **arrays and structs containing arrays are disallowed** |
|
|
40
|
+
| Count | **At most one** immediate variable statically accessed per entry point |
|
|
41
|
+
| Layout rules | Storage-space (natural alignment), **not** uniform-space |
|
|
42
|
+
| API | `pass.setImmediates(rangeOffset, data, dataOffset, dataSize)`, on render pass, compute pass and bundle encoders |
|
|
43
|
+
| Pipeline layout | `GPUPipelineLayoutDescriptor.immediateSize` (default 0, ≤ `maxImmediateSize`, multiple of 4) |
|
|
44
|
+
| Init | Bytes start zeroed but **slots start unset**; a draw reading an unset 4-byte slot is a validation error |
|
|
45
|
+
| Reset | Per-encoder; survives `setPipeline`, cleared by a new pass and by `executeBundles` |
|
|
46
|
+
|
|
47
|
+
Because `maxImmediateSize` is a `maximum`-class limit with a default of 64 and no compat-mode
|
|
48
|
+
reduction, **any adapter that exposes the WGSL extension reports at least 64 bytes**. There is no
|
|
49
|
+
device where the language feature is present and the budget is not. That is what makes a floor check
|
|
50
|
+
sufficient and a runtime branch unnecessary.
|
|
51
|
+
|
|
52
|
+
Availability is a browser-version question, not a hardware one: Vulkan's `maxPushConstantsSize` is
|
|
53
|
+
core-1.0 with a 128-byte required minimum and no feature bit, and no device in the
|
|
54
|
+
`vulkan.gpuinfo.org` corpus reports below 128. Chrome ships immediates in 149–150.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 2. The current path, traced
|
|
59
|
+
|
|
60
|
+
Shade already has this pattern, three layers deep.
|
|
61
|
+
|
|
62
|
+
**Declaration** — `ShaderResourceGroupDescriptor.addUniform` (`ShaderResourceGroupDescriptor.js:335`):
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
const PUSH_CONSTANTS = WebGPUStruct.from({
|
|
66
|
+
probe_index_offset: u32,
|
|
67
|
+
probe_update_count: u32,
|
|
68
|
+
probe_resolution: u32,
|
|
69
|
+
probe_count: u32
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
resources.createGroup()
|
|
73
|
+
.addUniform("settings", PUSH_CONSTANTS)
|
|
74
|
+
.addTexture("tAtlas_radiance");
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Codegen** — `ShaderResourceSetDescriptor.generateCodeChunk` (`ShaderResourceSetDescriptor.js:305`)
|
|
78
|
+
emits `@group(0) @binding(0) var<uniform> settings : PUSH_CONSTANTS;`.
|
|
79
|
+
|
|
80
|
+
**Upload, per dispatch** — `ShadeGPUCommandContext.allocateTransientValueBuffer` (`:598`):
|
|
81
|
+
|
|
82
|
+
```js
|
|
83
|
+
const settings = context.encoder.allocateTransientValueBuffer(PUSH_CONSTANTS, { … });
|
|
84
|
+
|
|
85
|
+
shader.dispatch({ encoder: context.encoder, bindings: { settings, … } });
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
which lands in `allocateTransientBuffer` (`:538`) → `GPUBufferAllocator.get` (pooled), then
|
|
89
|
+
`writeValueBuffer` (`:620`) → staging buffer → `copyBufferToBuffer`, then a `BindGroupDescriptor` hash
|
|
90
|
+
lookup in `GraphicsContext.setPipelineBindings` (`GraphicsContext.js:211`) and finally
|
|
91
|
+
`pass.setBindGroup(i, bind_group)`.
|
|
92
|
+
|
|
93
|
+
The FrameGraph route reaches the same place: `graph_compute_pass` → `graph_prepare_bindings` →
|
|
94
|
+
`encoder_prepare_shader_binding` (`:34`), which turns a raw value or `ArrayBuffer` into a transient
|
|
95
|
+
uniform buffer on the spot.
|
|
96
|
+
|
|
97
|
+
**Scale of the surface:**
|
|
98
|
+
|
|
99
|
+
- 67 `allocateTransientValueBuffer` call sites, 11 `allocateTransientBufferAndLoad`, 21 `graph_import_typed_buffer`
|
|
100
|
+
- 300 `addUniform` declarations; 22 of those *call sites* name a `*PUSH_CONSTANTS*` type, across
|
|
101
|
+
**20 distinct struct definitions** (`LPV_ACCUMULATION_PUSH_CONSTANTS` is shared by four shaders).
|
|
102
|
+
The table in §6 is per-struct, so it has 20 rows, not 22
|
|
103
|
+
- The single most common transient value type is a bare `u32` (12 sites)
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## 3. What the win actually is
|
|
108
|
+
|
|
109
|
+
Not bandwidth. 64 bytes at a few hundred dispatches a frame is noise on any bus.
|
|
110
|
+
|
|
111
|
+
The win is the machinery each of those 20-byte structs currently drags behind it:
|
|
112
|
+
|
|
113
|
+
1. **A pooled `GPUBuffer` acquire/release per value.** `GPUBufferAllocator.get` plus the transient
|
|
114
|
+
tracking array in `ShadeGPUCommandContext`, per dispatch, per frame.
|
|
115
|
+
2. **A staging buffer, a `getMappedRange`, an `unmap` and a `copyBufferToBuffer` per value** —
|
|
116
|
+
`writeValueBuffer` does all four for what is often four bytes.
|
|
117
|
+
3. **A `BindGroupDescriptor` construction plus a `HashMap` lookup per value**, and a cache entry
|
|
118
|
+
whose key changes every time the value changes — so the small-uniform bind groups are the ones
|
|
119
|
+
least likely to hit the cache.
|
|
120
|
+
4. **Two JS allocations per value, in the serialiser.** `writeValueBuffer` reaches
|
|
121
|
+
`write_gpu_typed_buffer`, which calls `scratch_buffer.fromArrayBuffer(data)`, which constructs a
|
|
122
|
+
fresh `DataView` and `Uint8Array` over the target every single call. Per dispatch, per frame, in a
|
|
123
|
+
codebase that advertises "zero-allocation" in its own package keywords. The immediate path writes
|
|
124
|
+
into a persistent `BinaryBuffer` and allocates nothing (§6, L3).
|
|
125
|
+
5. **A `@binding` slot** in the group the settings share.
|
|
126
|
+
|
|
127
|
+
Point 5 is *only* a binding, not a group. Measured across all twenty candidates: the settings uniform
|
|
128
|
+
shares its group with textures and storage buffers in every case, at a median of about four resources
|
|
129
|
+
per group. No bind group slot is recovered anywhere in the current codebase. (An earlier revision
|
|
130
|
+
claimed otherwise and built an argument on it; that argument is withdrawn.)
|
|
131
|
+
|
|
132
|
+
**The strongest case is `graph_import_typed_buffer`** (`renderer/shader/graph/graph_import_typed_buffer.js`,
|
|
133
|
+
21 call sites). It does not use the transient pool at all — per execution it calls `device.createBuffer`
|
|
134
|
+
with `mappedAtCreation`, `getMappedRange`, `unmap`, `copyBufferToBuffer`, then `destroy` on
|
|
135
|
+
`encoder.onFinished`. A full buffer create-and-destroy per frame per value, carrying things like
|
|
136
|
+
`LPV_ACCUMULATION_PUSH_CONSTANTS` at 20 bytes. The source carries a standing TODO ("this is pretty
|
|
137
|
+
inefficient, figure out a way to skip needing 2 buffers") and a 2025-09-13 note that the obvious fix —
|
|
138
|
+
transient buffer plus `queue.writeBuffer` — produced garbage for reasons never tracked down.
|
|
139
|
+
Immediates make the two-buffer dance unnecessary by construction for the ≤64-byte cases rather than
|
|
140
|
+
requiring that bug to be found first.
|
|
141
|
+
|
|
142
|
+
Caveat: converting a `graph_import_typed_buffer` site is *not* a drop-in. It returns a graph resource
|
|
143
|
+
id that passes consume as an ordinary binding, so the consuming pass stops declaring a graph input.
|
|
144
|
+
Higher payoff per site, higher cost per site.
|
|
145
|
+
|
|
146
|
+
Honest counterweight: on hardware, a 64-byte immediate may well land in a driver-managed constant
|
|
147
|
+
bank rather than in registers, so do not promise a shader-side speedup. Promise the removal of
|
|
148
|
+
CPU-side per-draw allocation, and measure the rest.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 4. The floor
|
|
153
|
+
|
|
154
|
+
Immediates become a floor requirement, stated in `RENDERER_CONTRACT.md` §2 next to
|
|
155
|
+
`indirect-first-instance` and `maxStorageBuffersPerShaderStage ≥ 10`, and checked in `Renderer.js`
|
|
156
|
+
using the idiom already there (`Renderer.js:1123`).
|
|
157
|
+
|
|
158
|
+
Two checks, both before the device is requested, so the failure names what was missing:
|
|
159
|
+
|
|
160
|
+
```js
|
|
161
|
+
// earliest — wgslLanguageFeatures lives on navigator.gpu, no adapter required
|
|
162
|
+
if (!gpu.wgslLanguageFeatures.has('immediate_address_space')) {
|
|
163
|
+
throw ShadeDeviceFailure.below_floor(
|
|
164
|
+
"requires WGSL immediate data (Chrome 149+); this browser does not support it"
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// beside the existing maxStorageBuffersPerShaderStage check, on the adapter
|
|
169
|
+
const maxImmediateSize = adapter.limits.maxImmediateSize;
|
|
170
|
+
if (maxImmediateSize < 64) {
|
|
171
|
+
throw ShadeDeviceFailure.below_floor(
|
|
172
|
+
`requires 64 bytes of immediate data, adapter offers ${maxImmediateSize}`
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
`below_floor` is the right reason code: an adapter that does not meet §2, with the detail. Nothing
|
|
178
|
+
goes in `requiredFeatures` — `immediate_address_space` is a WGSL language extension, not a
|
|
179
|
+
`GPUFeatureName`, and adding it there would make `requestDevice` reject on every device. Nothing goes
|
|
180
|
+
in `requiredLimits` either: 64 is the spec default, so a device gets it without asking.
|
|
181
|
+
|
|
182
|
+
**When the floor rises.** Not in the plumbing commits — a shader that declares no immediate emits no
|
|
183
|
+
`requires` directive and needs nothing. The floor and the checks land in the same commit as the
|
|
184
|
+
**first migrated shader** (§8 step 6), so the engine keeps running on older Chrome for as long as it
|
|
185
|
+
still can. That is one commit where the browser support statement changes, and it should say so in
|
|
186
|
+
its message.
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 5. The one structural obstacle
|
|
191
|
+
|
|
192
|
+
`ShaderResourceSetDescriptor` is a list of groups; a group is a list of resources; a resource has a
|
|
193
|
+
`binding_index`. Everything downstream — `generateBindings` returning `GPUBindingResource[][]`,
|
|
194
|
+
`generatePipelineLayoutDescriptor` producing one `BindGroupLayoutDescriptor` per group,
|
|
195
|
+
`generateCodeChunk` prefixing every declaration with `@group(g) @binding(b)` — assumes that shape.
|
|
196
|
+
|
|
197
|
+
An immediate has no group, no binding, and there is at most one per entry point. It has to live
|
|
198
|
+
*beside* the groups, and its value needs a second route to the pass encoder that ends in
|
|
199
|
+
`setImmediates` rather than `setBindGroup`.
|
|
200
|
+
|
|
201
|
+
Nothing about that requires a device, so the whole thing stays where Shade already does its work:
|
|
202
|
+
in descriptors built at module scope. `PipelineLayoutDescriptor` is device-free by design and stays
|
|
203
|
+
that way.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## 6. The landing plan
|
|
208
|
+
|
|
209
|
+
**L1 — declaration + codegen**
|
|
210
|
+
|
|
211
|
+
- `ShaderResourceSetDescriptor`: an `#immediate` slot beside `#groups`, a `setImmediate(name, type)`
|
|
212
|
+
that rejects a second call, plus validation at declaration time: `type.size <= 64`, no arrays
|
|
213
|
+
anywhere in the type (walk it — `WebGPUArray` members and nested structs both), no atomics, size a
|
|
214
|
+
multiple of 4.
|
|
215
|
+
- `generateCodeChunk` (`ShaderResourceSetDescriptor.js:305`): emit `var<immediate> name : Type;`
|
|
216
|
+
first, with no `@group`/`@binding` prefix.
|
|
217
|
+
- `ShaderDescriptor.compile` (`ShaderDescriptor.js:53`): the existing mechanism emits
|
|
218
|
+
`enable ${extension};`. Language extensions use **`requires`**. That needs a second channel on
|
|
219
|
+
`CodeChunk` — `addLanguageExtension` beside `addExtension` — and a `requires` line in the prelude.
|
|
220
|
+
Do not overload `addExtension`; its assert is against `WebGPUExtensionType`, which is the
|
|
221
|
+
`GPUFeatureName` namespace.
|
|
222
|
+
|
|
223
|
+
**L2 — pipeline layout**
|
|
224
|
+
|
|
225
|
+
- `PipelineLayoutDescriptor`: an `immediateSize = 0` field, threaded through `from`, `forStage`,
|
|
226
|
+
`fromJSON`, `hash`, `equals`, `copy`, `clone`. Missing it from `hash`/`equals` would silently alias
|
|
227
|
+
two layouts that differ only in immediate size — cheap mistake, expensive symptom.
|
|
228
|
+
- `PipelineLayoutManager.#create_pipeline_layout` (`PipelineLayoutManager.js:85`): pass it to
|
|
229
|
+
`createPipelineLayout`.
|
|
230
|
+
- `generatePipelineLayoutDescriptor` / `generatePipelineLayout`: set it from `roundUp(4, type.size)`.
|
|
231
|
+
|
|
232
|
+
**L3 — binding resolution and the call**
|
|
233
|
+
|
|
234
|
+
**Do not change the return shape of `generateBindings`.** Returning `{ groups, immediate }` would
|
|
235
|
+
break all **10** external callers (`GPUParticularRenderer`, `GPUDynamicMeshResidency`,
|
|
236
|
+
`graph_draw_lightmap_viz_buffer`, `prototypeParticleSystem`, `graph_atorus_denoise_luma`,
|
|
237
|
+
`graph_rasterize_meshes_transparent_oit`, `ComputeShader`, `ImageShader`, `RenderPassDescriptor`,
|
|
238
|
+
`GPUWaterRenderer`) and force the new field through the **22** external
|
|
239
|
+
`constructRenderPass`/`constructComputePass` call sites. Purely additive instead:
|
|
240
|
+
|
|
241
|
+
- `ShaderResourceSetDescriptor.writeImmediate(map, buffer)` — a *new* method that **allocates
|
|
242
|
+
nothing**. It writes the immediate value into a caller-owned `BinaryBuffer` at that buffer's
|
|
243
|
+
current `position`, advances `position` by the type's size, and returns `false` when the shader
|
|
244
|
+
declares no immediate. Every existing `generateBindings` caller is untouched.
|
|
245
|
+
|
|
246
|
+
Use the already-exported `write_wgsl_type_value(value, buffer, type)`
|
|
247
|
+
(`serde/write_gpu_typed_buffer.js:114`), which takes a `BinaryBuffer` directly. **Do not** route
|
|
248
|
+
this through `write_gpu_typed_buffer` (`:188`): that wrapper calls
|
|
249
|
+
`scratch_buffer.fromArrayBuffer(data)`, and `fromArrayBuffer` constructs `new DataView(data)` and
|
|
250
|
+
`new Uint8Array(data)` on every call — two allocations per write, and it resets `position` to 0.
|
|
251
|
+
The zero-allocation entry point already exists and is public; the wrapper is the thing to avoid.
|
|
252
|
+
|
|
253
|
+
- `GraphicsContext.setPipelineBindings` (`GraphicsContext.js:211`) gains an optional fourth
|
|
254
|
+
parameter — the `BinaryBuffer`, plus the byte offset and length written. After the `setBindGroup`
|
|
255
|
+
loop: `pass.setImmediates(0, buffer.data, byte_offset, byte_length)`. `setImmediates` takes
|
|
256
|
+
`AllowSharedBufferSource`, and for a plain `ArrayBuffer` the offset and size arguments are in
|
|
257
|
+
**bytes**, so the backing store is passed through with no copy on our side. All four existing
|
|
258
|
+
callers keep working.
|
|
259
|
+
|
|
260
|
+
- `ImageShader.draw` and `ComputeShader.constructPass`/`dispatch` set `position`, call
|
|
261
|
+
`writeImmediate`, and thread the buffer plus range through as optional fields.
|
|
262
|
+
|
|
263
|
+
Three properties of `BinaryBuffer` that this design has to respect:
|
|
264
|
+
|
|
265
|
+
1. **`data` is not stable.** `setCapacity` (and therefore `ensureCapacity`) reallocates the backing
|
|
266
|
+
`ArrayBuffer` and rebinds `dataView` / `__data_uint8`. Read `buffer.data` at the point of the
|
|
267
|
+
`setImmediates` call, never cache it — and size the buffer once at construction so it never grows
|
|
268
|
+
mid-frame.
|
|
269
|
+
2. **Endianness is not the default.** `BinaryBuffer` defaults to `EndianType.LittleEndian`, but the
|
|
270
|
+
serde module's own scratch sets `endianness = platform_compute_endianness()` (`:179`) because GPU
|
|
271
|
+
buffer contents must match the host. A caller-supplied buffer that skips this writes correct-looking
|
|
272
|
+
bytes that are wrong on a big-endian host and identical on the one you test on. Set it at
|
|
273
|
+
construction, and assert it in `writeImmediate`.
|
|
274
|
+
3. **Ownership.** One long-lived buffer on `ShadeGPUCommandContext`, sized to `maxImmediateSize` at
|
|
275
|
+
construction, is enough — `setImmediates` copies the bytes at call time, so the region is free for
|
|
276
|
+
reuse immediately after. The API is still parameterised on `position` rather than hardcoding 0,
|
|
277
|
+
because that costs nothing and leaves room for a caller that wants to stage several values or keep
|
|
278
|
+
a frame log of them.
|
|
279
|
+
- `encoder_prepare_shader_binding` (`:34`): in the immediate case, return the raw value rather than
|
|
280
|
+
allocating a transient buffer.
|
|
281
|
+
|
|
282
|
+
**The eight bypass paths.** `setPipelineBindings` does not cover everything. Eight files drive
|
|
283
|
+
`pass.setBindGroup` directly and never touch it — `GPUMaterialManager`, `prototypeParticleSystem`,
|
|
284
|
+
`graph_build_depth_mipmap`, `render_copy_texture`, `graph_rasterize_meshes_alpha_tested`,
|
|
285
|
+
`graph_rasterize_meshes_transparent_oit`, `draw_texture_as_rgba`, `WebGPUMipmapGenerator`. A shader
|
|
286
|
+
migrated in one of those needs its own `setImmediates` call at the right point in the loop. None of
|
|
287
|
+
the twenty candidates lives there, so this constrains future migration rather than this landing — but
|
|
288
|
+
it must not be assumed away.
|
|
289
|
+
|
|
290
|
+
**L4 — the test tiers**
|
|
291
|
+
|
|
292
|
+
Without a fallback these are not optional: they are the only way immediates get exercised outside a
|
|
293
|
+
browser.
|
|
294
|
+
|
|
295
|
+
- **WGSL validation** (`wgsl/validate_wgsl_source.js`) — teach it that `var<immediate>` is legal and
|
|
296
|
+
`requires immediate_address_space;` is a valid directive, so the new declaration does not trip the
|
|
297
|
+
foreign-token or undeclared-call rules.
|
|
298
|
+
- **JS emulator** — a real trap. `collectGlobalVariable`
|
|
299
|
+
(`wgsl/emulator/WGSLJavaScriptCompiler.js:825`) only pushes to `globalBindings` when *both* `group`
|
|
300
|
+
and `binding` are non-null (`:862`). A `var<immediate>` has neither, is not `workgroup`, and falls
|
|
301
|
+
through to the `privateGlobals` branch, where it is **silently default-initialised**. Every emulator
|
|
302
|
+
spec for an immediate-using chunk would pass while reading zeros. Route
|
|
303
|
+
`address_space === 'immediate'` into `globalBindings` with a null group/binding so
|
|
304
|
+
`emu.bindings.settings = {…}` keeps working by name.
|
|
305
|
+
- **SoftwareGPUDevice** — `DEFAULT_LIMITS.maxImmediateSize` (`mock/SoftwareGPUDevice.js:67`) is
|
|
306
|
+
already present, set to `0`. Raise it to 64, add `setImmediates` to `SoftwareGPURenderPassEncoder`
|
|
307
|
+
(`:130`) and `SoftwareGPUComputePassEncoder` (`:108`) with the spec's `[[immediate_data]]` /
|
|
308
|
+
`[[immediate_slots_set]]` state, validate `rangeOffset % 4`, size `% 4` and the range bound, and
|
|
309
|
+
snapshot the bytes into each recorded draw/dispatch the way `#snapshot_bindings` already snapshots
|
|
310
|
+
bind groups. Follow the folder's stated policy in `mock/IMPLEMENTATION_PLAN.md` §2: validation
|
|
311
|
+
errors go through `generate_error`, they do not throw. `createPipelineLayout` (`:766`) gains the
|
|
312
|
+
`immediateSize ≤ maxImmediateSize` and `% 4` checks. Emulate the unset-slot rule too — it is the
|
|
313
|
+
mock's chance to catch a missing `setImmediates` before a browser does.
|
|
314
|
+
- **Playground** — one pass converted end to end and run in Chrome before any bulk migration.
|
|
315
|
+
|
|
316
|
+
**L5 — migration**
|
|
317
|
+
|
|
318
|
+
Smallest first. `shader_read_out_bucket` (4 bytes, one `u32`) is the ideal first patient;
|
|
319
|
+
`shader_generate_rays` and `shader_shadow_upscale` are the same shape.
|
|
320
|
+
|
|
321
|
+
**It is not one line per shader.** Only 5 of the 20 candidates supply their settings implicitly, by
|
|
322
|
+
passing a plain object in `bindings` and letting `encoder_prepare_shader_binding` allocate. The other
|
|
323
|
+
~15 have an explicit `allocateTransientValueBuffer` or `graph_import_typed_buffer` call that
|
|
324
|
+
pre-builds the buffer and passes the `GPUBuffer`. Those need two edits: the declaration, and the call
|
|
325
|
+
site that stops pre-allocating.
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## 7. Candidate inventory
|
|
330
|
+
|
|
331
|
+
Every struct named `*PUSH_CONSTANTS*`, sized by `WebGPUStruct` (the same natural-alignment layout the
|
|
332
|
+
`immediate` address space uses). Sizes were re-derived programmatically — field lists extracted from
|
|
333
|
+
source and fed back through the real `WebGPUStruct.from`, not computed by hand.
|
|
334
|
+
|
|
335
|
+
| Struct | Size | Verdict |
|
|
336
|
+
|---|---:|---|
|
|
337
|
+
| `shader_read_out_bucket` | 4 | fits |
|
|
338
|
+
| `shader_generate_rays` | 4 | fits |
|
|
339
|
+
| `shader_shadow_upscale` | 4 | fits |
|
|
340
|
+
| `shader_sharc_evict` | 8 | fits |
|
|
341
|
+
| `shader_lightmap_accummulate_tile` | 8 | fits |
|
|
342
|
+
| `shader_lightmap_tile_composit` | 8 | fits |
|
|
343
|
+
| `graph_lpv_store_sh` | 16 | fits |
|
|
344
|
+
| `shader_perfect_perspective` | 16 | fits, see note |
|
|
345
|
+
| `graph_lvp_atlas_to_sh` | 20 | fits |
|
|
346
|
+
| `LPV_ACCUMULATION_PUSH_CONSTANTS` | 20 | fits |
|
|
347
|
+
| `shader_lpv_accumulate_depth` | 20 | fits |
|
|
348
|
+
| `graph_sample_light_probes` | 20 | fits |
|
|
349
|
+
| `graph_reduce_atlas_to_sh` | 24 | fits |
|
|
350
|
+
| `shader_lpv_build_gbuffer` | 24 | fits |
|
|
351
|
+
| `shader_update_clipmap_cascade` | 32 | fits |
|
|
352
|
+
| `graph_lpv_shade` | 32 | fits |
|
|
353
|
+
| `shader_build_scene_sdf_f32` | 32 | fits |
|
|
354
|
+
| `shader_scene_sdf_debug_viz` | 32 | fits |
|
|
355
|
+
| `shader_scene_sdf_soft_shadows` | 48 | fits |
|
|
356
|
+
| `LIGHT_CLUSTER_ASSIGNMENT_PUSH_CONSTANTS` | 128 | **cannot move** |
|
|
357
|
+
|
|
358
|
+
`LIGHT_CLUSTER_ASSIGNMENT_PUSH_CONSTANTS` fails twice: 128 bytes against a 64-byte budget, and
|
|
359
|
+
`frustum: WebGPUArray.from(vec4f, 6)` is an array, which the `immediate` address space disallows
|
|
360
|
+
outright. It stays a uniform buffer. If the rest is worth moving later, the split is
|
|
361
|
+
`{cluster_params, screen_resolution, distance_min, distance_max}` at 32 bytes as an immediate with the
|
|
362
|
+
frustum left in a buffer — a follow-up, not part of this landing.
|
|
363
|
+
|
|
364
|
+
Note on `shader_perfect_perspective`: its `use_vignette` member is typed `bool`, and Shade's `bool`
|
|
365
|
+
primitive (`WEBGPU_WGSL_PRIMITIVE_TYPES.js:8`) is a 4-byte type. WGSL's host-shareable set is numeric
|
|
366
|
+
scalars, vectors, matrices, atomics, arrays and structs of those — `bool` is in none of them, in *any*
|
|
367
|
+
address space, uniform included. So this is a pre-existing condition rather than something immediates
|
|
368
|
+
introduce, but the member needs to become `u32` before this struct can move. Worth checking whether
|
|
369
|
+
that shader is reachable at all; grep finds no importer.
|
|
370
|
+
|
|
371
|
+
Beyond the named ones, the 12 bare-`u32` `allocateTransientValueBuffer` sites are the same pattern
|
|
372
|
+
without the naming, and are equally good candidates.
|
|
373
|
+
|
|
374
|
+
### What must not move
|
|
375
|
+
|
|
376
|
+
`CAMERA_UNIFORM_STRUCT` (~640 bytes: eight `mat4x4f`, a six-element `vec4f` frustum array, and more)
|
|
377
|
+
and `VIEW_UNIFORM_STRUCT` account for 116 of the 300 `addUniform` calls. They are per-view, written
|
|
378
|
+
once, read by everything — over budget, containing arrays, and not per-draw data. They stay. Same for
|
|
379
|
+
anything reached through `GPUDatabase` or `GPUSingleTypeTable`.
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
383
|
+
## 8. Commit sequence
|
|
384
|
+
|
|
385
|
+
Steps 1–5 are inert without a shader that declares an immediate, so the engine still runs on older
|
|
386
|
+
Chrome throughout. Step 6 is where the floor rises.
|
|
387
|
+
|
|
388
|
+
1. `feat(shade): the software device carries immediate data` — L4's mock work alone. Raises
|
|
389
|
+
`maxImmediateSize` to 64, adds `setImmediates` to both pass encoders with spec state and
|
|
390
|
+
validation, `immediateSize` validation on `createPipelineLayout`.
|
|
391
|
+
Note while doing this: the `DEFAULT_LIMITS` doc comment claims the table was "verified field by
|
|
392
|
+
field against a Dawn default device (`webgpu` package, already a dependency)". **That package is
|
|
393
|
+
not a dependency** — `webgpu` appears in `package.json` only as a `keywords` entry, and is absent
|
|
394
|
+
from `node_modules`. So `maxImmediateSize: 0` cannot be re-verified from this repo, and raising it
|
|
395
|
+
to 64 rests on the spec's `maximum`-class default rather than a Dawn reading. Say that in the
|
|
396
|
+
comment instead of repeating an unverifiable citation.
|
|
397
|
+
2. `fix(shade): the emulator does not silently zero an immediate` — the `WGSLJavaScriptCompiler`
|
|
398
|
+
fall-through at `:862`, plus the `validate_wgsl_source` rules. A spec that fails before and passes
|
|
399
|
+
after.
|
|
400
|
+
3. `feat(shade): pipeline layouts carry an immediate size` — L2, pinned by a `SoftwareGPUDevice` spec.
|
|
401
|
+
4. `feat(shade): shaders can declare immediate data` — L1. The `requires` channel on `CodeChunk`,
|
|
402
|
+
`setImmediate` on the set descriptor, the declaration-time validation.
|
|
403
|
+
5. `feat(shade): immediate data reaches the pass encoder` — L3. `generateImmediateBytes`, the optional
|
|
404
|
+
`setPipelineBindings` parameter, `encoder_prepare_shader_binding` stops allocating for immediates.
|
|
405
|
+
6. `feat(shade): immediate data joins the device floor` — the two `Renderer.js` checks, the
|
|
406
|
+
`RENDERER_CONTRACT.md` §2 amendment, **and** the first migrated shader
|
|
407
|
+
(`shader_read_out_bucket`), together. This is the commit that raises the browser requirement to
|
|
408
|
+
Chrome 149+; its message should say so plainly.
|
|
409
|
+
7. `refactor(shade): <pass> passes its settings as immediate data` — one per shader thereafter.
|
|
410
|
+
|
|
411
|
+
Measure between 6 and 7, and again after the first handful of 7s: transient buffer acquisitions per
|
|
412
|
+
frame and bind-group cache misses per frame are the two numbers that should move. If they do not,
|
|
413
|
+
stop migrating the `allocateTransientValueBuffer` sites and spend the effort on the
|
|
414
|
+
`graph_import_typed_buffer` consumers instead, where the per-frame cost is a whole buffer rather than
|
|
415
|
+
a pool hit.
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
## 9. If a fallback is ever wanted anyway
|
|
420
|
+
|
|
421
|
+
It belongs in a shader variant, not in the binding machinery — and Shade already supports that with
|
|
422
|
+
no new mechanism. `ShaderDescriptor.compile()` clones the body chunk and adds the resource set's
|
|
423
|
+
generated chunk as a dependency:
|
|
424
|
+
|
|
425
|
+
```js
|
|
426
|
+
const chunk = this.#body.clone();
|
|
427
|
+
chunk.addDependency(this.#resources.generateCodeChunk());
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
So one `CodeChunk` body pairs with two different `ShaderResourceSetDescriptor`s to produce two
|
|
431
|
+
`ShaderDescriptor`s — immediate and uniform — from a single source of shader text, selected by
|
|
432
|
+
whoever constructs them. The body never changes: `settings.probe_count` reads identically either way.
|
|
433
|
+
|
|
434
|
+
That is a per-shader, opt-in decision made by the shader's author, which is a very different thing
|
|
435
|
+
from a capability branch threaded through codegen, pipeline layout, binding resolution and the test
|
|
436
|
+
harness. Keeping the door open costs nothing; walking through it preemptively cost a great deal.
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
## 10. Open questions
|
|
441
|
+
|
|
442
|
+
- **Is Chrome 149+ acceptable as the engine floor, and when?** This is now the only gating question
|
|
443
|
+
in the plan. Steps 1–5 can land regardless; step 6 needs an answer. Immediates are in Chrome
|
|
444
|
+
149–150, so the answer is partly a calendar question about how far behind the target audience runs.
|
|
445
|
+
- **Should `setImmediate` live on `ShaderResourceSetDescriptor` or on `ShaderDescriptor`?** The set
|
|
446
|
+
descriptor is where every other resource is declared; but an immediate is not a bound resource —
|
|
447
|
+
the spec is explicit that it is part of the *shader interface*, not the *resource interface*.
|
|
448
|
+
Recommendation: the set descriptor, because that is what `generateCodeChunk` and the binding path
|
|
449
|
+
already walk, and splitting across two objects buys nothing.
|
|
450
|
+
- **Is 64 bytes worth revisiting later?** `maxImmediateSize` is raisable, but D3D12's root signature
|
|
451
|
+
budget means no browser is likely to expose more. Plan around 64 permanently.
|
|
@@ -35,6 +35,27 @@ export class ShadeGPUCommandContext {
|
|
|
35
35
|
* @param {function} debug_timers_callback
|
|
36
36
|
*/
|
|
37
37
|
enable_debug_timers(debug_timers_callback: Function): void;
|
|
38
|
+
/**
|
|
39
|
+
* Resolves after this context's timings have been read back and handed to its recorder.
|
|
40
|
+
*
|
|
41
|
+
* **Not the same moment as {@link done}.** `done` resolves from `onFinished`, which fires
|
|
42
|
+
* synchronously at submit — before any timestamp has been read. A caller that closes its frame
|
|
43
|
+
* on `done` commits an empty one, every time. Already-resolved when nothing is profiling.
|
|
44
|
+
*
|
|
45
|
+
* @returns {Promise<void>}
|
|
46
|
+
*/
|
|
47
|
+
get profiling_absorbed(): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Record this context's pass timings into `recorder`.
|
|
50
|
+
*
|
|
51
|
+
* Independent of {@link enable_debug_timers}, which is the console-shaped one-off; both share
|
|
52
|
+
* the underlying {@link GPUTimerArray} and either may enable it.
|
|
53
|
+
*
|
|
54
|
+
* @param {GPUFrameRecorder} recorder
|
|
55
|
+
* @param {number} query_set_id this context's index within the frame
|
|
56
|
+
* @returns {void}
|
|
57
|
+
*/
|
|
58
|
+
enable_profiling(recorder: GPUFrameRecorder, query_set_id: number): void;
|
|
38
59
|
/**
|
|
39
60
|
*
|
|
40
61
|
* @return {GPUDevice}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShadeGPUCommandContext.d.ts","sourceRoot":"","sources":["../../../../src/shade/device/ShadeGPUCommandContext.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ShadeGPUCommandContext.d.ts","sourceRoot":"","sources":["../../../../src/shade/device/ShadeGPUCommandContext.js"],"names":[],"mappings":"AA+BA;;;;;;GAMG;AACH;IAkPI;;;;;OAKG;IACH,iDAHW,MAAM,GACJ,sBAAsB,CA6BlC;IA/QD;;;;OAIG;IACH,iBAEC;IAED;;;OAGG;IACH,mCAEC;IASD;;;;OAIG;IACH,qCAEC;IAaD;;;OAGG;IACH,2DAQC;IA8DD;;;;;;;;OAQG;IACH,wCAEC;IAED;;;;;;;;;OASG;IACH,2DAHW,MAAM,GACJ,IAAI,CAiBhB;IAOD;;;OAGG;IACH,wBAEC;IAED;;;OAGG;IACH,+BAEC;IAqBD;;;OAGG;IACH,yBAA0B;IAE1B;;;OAGG;IACH,6BAA8B;IAE9B;;;OAGG;IACH,0BAcC;IA6CD;;;OAGG;IACH,2BAFa,wBAAwB,CAIpC;IAED;;;OAGG;IACH,qCAWC;IAED;;;;;OAKG;IACH,wCAHW,MAAM,SACN,MAAM,QAWhB;IAED;;;;OAIG;IACH,qBAEC;IAED;;;;;;;;;OASG;IACH,oDALW,MAAM,6CAEN,MAAM,SACN,MAAM,QAqChB;IAGD;;;;;OAKG;IACH,uHAKC;IAED;;;;OAIG;IACH,+EAQC;IA+DD;;;;;;OAMG;IACH,sGA6BC;IAoCD;;;;OAIG;IACH,sBAFW,MAAM,QAOhB;IAED;;;OAGG;IACH,sBAIC;IAED;;;;OAIG;IACH,yBAFW,MAAM,QAKhB;IAED;;;;;;;;OAQG;IACH,+FAPW,MAAM,wBA2ChB;IAED;;;;OAIG;IACH,2EAOC;IAED;;;;;;;OAOG;IACH,mDALW,MAAM,cACN,MAAM,6CAEN,MAAM,QAIhB;IAED;;;;;;OAMG;IACH,2CAFY,OAAO,CAYlB;IAUD;;;;;;OAMG;IACH,+BAJW,MAAM,iBAAe,QACrB,MAAM,aAuBhB;IAED;;;;;;;OAOG;IACH,qCANW,WAAW,UACX,MAAM,iBAAe,WACrB,MAAM,SACN,MAAM,aAwBhB;IAED;;;;;;OAMG;IACH,oEAHW,MAAM,iBAAe,aAgB/B;IAED;;;;;;OAMG;IACH,wDAJW,MAAM,sCAuBhB;IAED;;;;;;;OAOG;IACH,8CALW,MAAM,QACN,WAAW,eACX,MAAM,QACN,MAAM,QAuBhB;IA0BD;;OAEG;IACH,eAgEC;;CACJ;yCAh6BwC,qCAAqC"}
|