@woosh/meep-engine 3.14.0 → 3.14.2
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 +33 -64
- package/package.json +1 -1
- package/src/avif/native/DECISIONS.md +544 -536
- package/src/avif/native/heif/parse_avif_file.d.ts.map +1 -1
- package/src/avif/native/heif/parse_avif_file.js +384 -383
- package/src/avif/native/heif/parse_image_grid.d.ts.map +1 -1
- package/src/avif/native/heif/parse_image_grid.js +49 -48
- package/src/basis/BasisBitReader.d.ts +77 -0
- package/src/basis/BasisBitReader.d.ts.map +1 -0
- package/src/basis/BasisBitReader.js +231 -0
- package/src/basis/BasisHuffmanTable.d.ts +53 -0
- package/src/basis/BasisHuffmanTable.d.ts.map +1 -0
- package/src/basis/BasisHuffmanTable.js +263 -0
- package/src/basis/basis_read_huffman_table.d.ts +20 -0
- package/src/basis/basis_read_huffman_table.d.ts.map +1 -0
- package/src/basis/basis_read_huffman_table.js +187 -0
- package/src/basis/etc1s/Etc1sSelectorHistory.d.ts +50 -0
- package/src/basis/etc1s/Etc1sSelectorHistory.d.ts.map +1 -0
- package/src/basis/etc1s/Etc1sSelectorHistory.js +89 -0
- package/src/basis/etc1s/etc1s_block_colors.d.ts +14 -0
- package/src/basis/etc1s/etc1s_block_colors.d.ts.map +1 -0
- package/src/basis/etc1s/etc1s_block_colors.js +75 -0
- package/src/basis/etc1s/etc1s_decode_slice.d.ts +57 -0
- package/src/basis/etc1s/etc1s_decode_slice.d.ts.map +1 -0
- package/src/basis/etc1s/etc1s_decode_slice.js +258 -0
- package/src/basis/etc1s/etc1s_read_endpoint_codebook.d.ts +48 -0
- package/src/basis/etc1s/etc1s_read_endpoint_codebook.d.ts.map +1 -0
- package/src/basis/etc1s/etc1s_read_endpoint_codebook.js +111 -0
- package/src/basis/etc1s/etc1s_read_selector_codebook.d.ts +42 -0
- package/src/basis/etc1s/etc1s_read_selector_codebook.d.ts.map +1 -0
- package/src/basis/etc1s/etc1s_read_selector_codebook.js +127 -0
- package/src/basis/etc1s/etc1s_read_slice_tables.d.ts +54 -0
- package/src/basis/etc1s/etc1s_read_slice_tables.d.ts.map +1 -0
- package/src/basis/etc1s/etc1s_read_slice_tables.js +47 -0
- package/src/basis/transcode/build_range_plan.js +54 -0
- package/src/basis/transcode/etc1s_to_bc1.d.ts +24 -0
- package/src/basis/transcode/etc1s_to_bc1.d.ts.map +1 -0
- package/src/basis/transcode/etc1s_to_bc1.js +205 -0
- package/src/basis/transcode/etc1s_to_bc7.d.ts +30 -0
- package/src/basis/transcode/etc1s_to_bc7.d.ts.map +1 -0
- package/src/basis/transcode/etc1s_to_bc7.js +496 -0
- package/src/basis/transcode/fit_endpoints.d.ts +59 -0
- package/src/basis/transcode/fit_endpoints.d.ts.map +1 -0
- package/src/basis/transcode/fit_endpoints.js +226 -0
- package/src/{avif/native/isobmff → core/binary}/ByteCursor.d.ts +19 -6
- package/src/core/binary/ByteCursor.d.ts.map +1 -0
- package/src/{avif/native/isobmff → core/binary}/ByteCursor.js +41 -14
- package/src/engine/EngineHarness.js +1 -1
- package/src/engine/asset/codec/Codec.d.ts.map +1 -0
- package/src/engine/asset/codec/CodecWithFallback.d.ts.map +1 -0
- package/src/engine/asset/{loaders/image/codec → codec}/CodecWithFallback.js +2 -2
- package/src/engine/asset/loaders/image/IMAGE_CODEC_REVIEW_2026_08_28.md +4 -4
- package/src/engine/asset/loaders/image/ImageRGBADataLoader.d.ts +1 -1
- package/src/engine/asset/loaders/image/ImageRGBADataLoader.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/ImageRGBADataLoader.js +1 -1
- package/src/engine/asset/loaders/image/codec/NativeImageDecoder.d.ts +1 -1
- package/src/engine/asset/loaders/image/codec/NativeImageDecoder.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/codec/NativeImageDecoder.js +1 -1
- package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.d.ts +1 -1
- package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.js +1 -1
- package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts.map +1 -1
- package/src/engine/graphics/texture/atlas/TextureAtlas.js +13 -0
- package/src/engine/physics/broadphase/generate_pairs.d.ts.map +1 -1
- package/src/engine/physics/broadphase/generate_pairs.js +7 -1
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/ktx2/KTX2_IDENTIFIER.d.ts +14 -0
- package/src/ktx2/KTX2_IDENTIFIER.d.ts.map +1 -0
- package/src/ktx2/KTX2_IDENTIFIER.js +15 -0
- package/src/ktx2/KhrDfModel.d.ts +35 -0
- package/src/ktx2/KhrDfModel.d.ts.map +1 -0
- package/src/ktx2/KhrDfModel.js +49 -0
- package/src/ktx2/SupercompressionScheme.d.ts +16 -0
- package/src/ktx2/SupercompressionScheme.d.ts.map +1 -0
- package/src/ktx2/SupercompressionScheme.js +23 -0
- package/src/ktx2/ktx2_read.d.ts +71 -0
- package/src/ktx2/ktx2_read.d.ts.map +1 -0
- package/src/ktx2/ktx2_read.js +581 -0
- package/src/ktx2/ktx2_read_basis_lz_global_data.d.ts +27 -0
- package/src/ktx2/ktx2_read_basis_lz_global_data.d.ts.map +1 -0
- package/src/ktx2/ktx2_read_basis_lz_global_data.js +189 -0
- package/src/ktx2/vk_format_to_texture_format.d.ts +55 -0
- package/src/ktx2/vk_format_to_texture_format.d.ts.map +1 -0
- package/src/ktx2/vk_format_to_texture_format.js +290 -0
- package/src/shade/descriptor/GPUTextureUsage.d.ts +23 -0
- package/src/shade/descriptor/GPUTextureUsage.d.ts.map +1 -0
- package/src/shade/descriptor/GPUTextureUsage.js +24 -0
- package/src/shade/descriptor/WebGPUExtensionType.d.ts +3 -0
- package/src/shade/descriptor/WebGPUExtensionType.js +26 -0
- package/src/shade/descriptor/texture/TextureDescriptor.d.ts +2 -6
- package/src/shade/descriptor/texture/TextureDescriptor.d.ts.map +1 -1
- package/src/shade/descriptor/texture/TextureDescriptor.js +24 -40
- package/src/shade/descriptor/texture/format/TextureFormat.d.ts +125 -0
- package/src/shade/descriptor/texture/format/TextureFormat.d.ts.map +1 -0
- package/src/shade/descriptor/texture/format/TextureFormat.js +146 -0
- package/src/shade/descriptor/texture/format/gpu_texture_format_info.d.ts +60 -0
- package/src/shade/descriptor/texture/format/gpu_texture_format_info.d.ts.map +1 -1
- package/src/shade/descriptor/texture/format/gpu_texture_format_info.js +102 -0
- package/src/shade/device/graph/TextureResourceDescriptor.d.ts.map +1 -1
- package/src/shade/device/graph/TextureResourceDescriptor.js +160 -155
- package/src/shade/device/mock/SoftwareGPUQueue.d.ts +11 -4
- package/src/shade/device/mock/SoftwareGPUQueue.d.ts.map +1 -1
- package/src/shade/device/mock/SoftwareGPUQueue.js +31 -37
- package/src/shade/device/mock/SoftwareGPUTexture.d.ts.map +1 -1
- package/src/shade/device/mock/SoftwareGPUTexture.js +8 -4
- package/src/shade/device/timing/profile/frame_graph_extract_topology.d.ts.map +1 -1
- package/src/shade/device/timing/profile/frame_graph_extract_topology.js +164 -174
- package/src/shade/playground/ground_seam/README.md +235 -0
- package/src/shade/playground/ground_seam/capture_scene_color.d.ts +45 -0
- package/src/shade/playground/ground_seam/capture_scene_color.d.ts.map +1 -0
- package/src/shade/playground/ground_seam/capture_scene_color.js +242 -0
- package/src/shade/playground/ground_seam/depth_step_across_seam.d.ts +11 -0
- package/src/shade/playground/ground_seam/depth_step_across_seam.d.ts.map +1 -0
- package/src/shade/playground/ground_seam/depth_step_across_seam.js +185 -0
- package/src/shade/playground/ground_seam/index.html +195 -0
- package/src/shade/playground/ground_seam/main.d.ts +2 -0
- package/src/shade/playground/ground_seam/main.d.ts.map +1 -0
- package/src/shade/playground/ground_seam/main.js +879 -0
- package/src/shade/playground/ground_seam/make_grid_texture.d.ts +29 -0
- package/src/shade/playground/ground_seam/make_grid_texture.d.ts.map +1 -0
- package/src/shade/playground/ground_seam/make_grid_texture.js +105 -0
- package/src/shade/playground/ground_seam/make_ground.d.ts +70 -0
- package/src/shade/playground/ground_seam/make_ground.d.ts.map +1 -0
- package/src/shade/playground/ground_seam/make_ground.js +161 -0
- package/src/shade/playground/ground_seam/measure_flicker.d.ts +71 -0
- package/src/shade/playground/ground_seam/measure_flicker.d.ts.map +1 -0
- package/src/shade/playground/ground_seam/measure_flicker.js +531 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +2519 -2511
- package/src/shade/renderer/hiz/HierarchicalZBuffer.d.ts.map +1 -1
- package/src/shade/renderer/hiz/HierarchicalZBuffer.js +275 -274
- package/src/shade/renderer/light/GPULightCollection.d.ts.map +1 -1
- package/src/shade/renderer/light/GPULightCollection.js +323 -314
- package/src/shade/renderer/lightmap/GPULightMap.js +336 -336
- package/src/shade/renderer/material/resident/GPUResidentMaterialContext.d.ts.map +1 -1
- package/src/shade/renderer/material/resident/GPUResidentMaterialContext.js +12 -2
- package/src/shade/renderer/material/standard/fragment_gbuffer.d.ts.map +1 -1
- package/src/shade/renderer/material/standard/fragment_gbuffer.js +3 -1
- package/src/shade/renderer/material/standard/fragment_gbuffer_vt.js +169 -169
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.js +3 -1
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/rasterize/native/oit/chunk_forward_shade_standard_fragment_brick4.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/oit/chunk_forward_shade_standard_fragment_brick4.js +3 -1
- package/src/shade/renderer/rasterize/native/oit/chunk_forward_shade_standard_fragment_ibl.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/oit/chunk_forward_shade_standard_fragment_ibl.js +3 -1
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_tangent_normal.d.ts +28 -0
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_tangent_normal.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_tangent_normal.js +39 -0
- package/src/shade/renderer/shader/chunk/geometry/triangle/chunk_barycentric_full.d.ts +45 -0
- package/src/shade/renderer/shader/chunk/geometry/triangle/chunk_barycentric_full.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/triangle/chunk_barycentric_full.js +94 -61
- package/src/shade/renderer/shader/chunk/geometry/triangle/chunk_barycentric_solve.d.ts +24 -0
- package/src/shade/renderer/shader/chunk/geometry/triangle/chunk_barycentric_solve.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/geometry/triangle/chunk_barycentric_solve.js +43 -0
- package/src/shade/renderer/texture/COMPRESSED_TEXTURE_PLAN_2026_09_01.md +1462 -0
- package/src/shade/renderer/texture/TextureManager.d.ts.map +1 -1
- package/src/shade/renderer/texture/TextureManager.js +20 -8
- package/src/shade/renderer/texture/TextureRole.d.ts +19 -0
- package/src/shade/renderer/texture/TextureRole.d.ts.map +1 -0
- package/src/shade/renderer/texture/TextureRole.js +26 -0
- package/src/shade/renderer/texture/TextureVariantSet.d.ts +71 -0
- package/src/shade/renderer/texture/TextureVariantSet.d.ts.map +1 -0
- package/src/shade/renderer/texture/TextureVariantSet.js +105 -0
- package/src/shade/renderer/texture/download_texture_data.d.ts.map +1 -1
- package/src/shade/renderer/texture/download_texture_data.js +22 -0
- package/src/shade/renderer/texture/format/gpu_texture_compression_support.d.ts +15 -0
- package/src/shade/renderer/texture/format/gpu_texture_compression_support.d.ts.map +1 -0
- package/src/shade/renderer/texture/format/gpu_texture_compression_support.js +50 -0
- package/src/shade/renderer/texture/format/gpu_texture_format_can_generate_mipmaps.d.ts +27 -0
- package/src/shade/renderer/texture/format/gpu_texture_format_can_generate_mipmaps.d.ts.map +1 -0
- package/src/shade/renderer/texture/format/gpu_texture_format_can_generate_mipmaps.js +65 -0
- package/src/shade/renderer/texture/format/infer_format_from_parameters.d.ts +11 -0
- package/src/shade/renderer/texture/format/infer_format_from_parameters.d.ts.map +1 -0
- package/src/shade/renderer/texture/format/infer_format_from_parameters.js +88 -0
- package/src/shade/renderer/texture/format/texture_format_from_shade_image.d.ts +24 -0
- package/src/shade/renderer/texture/format/texture_format_from_shade_image.d.ts.map +1 -0
- package/src/shade/renderer/texture/format/texture_format_from_shade_image.js +71 -0
- package/src/shade/renderer/texture/format/texture_format_preference.d.ts +22 -0
- package/src/shade/renderer/texture/format/texture_format_preference.d.ts.map +1 -0
- package/src/shade/renderer/texture/format/texture_format_preference.js +89 -0
- package/src/shade/renderer/texture/format/texture_variant_select.d.ts +24 -0
- package/src/shade/renderer/texture/format/texture_variant_select.d.ts.map +1 -0
- package/src/shade/renderer/texture/format/texture_variant_select.js +38 -0
- package/src/shade/renderer/texture/shade_texture_might_have_alpha.d.ts +9 -1
- package/src/shade/renderer/texture/shade_texture_might_have_alpha.d.ts.map +1 -1
- package/src/shade/renderer/texture/shade_texture_might_have_alpha.js +73 -8
- package/src/shade/renderer/texture/source/AlphaMode.d.ts +27 -0
- package/src/shade/renderer/texture/source/AlphaMode.d.ts.map +1 -0
- package/src/shade/renderer/texture/source/AlphaMode.js +52 -0
- package/src/shade/renderer/texture/source/ShadeImage.d.ts +33 -0
- package/src/shade/renderer/texture/source/ShadeImage.d.ts.map +1 -1
- package/src/shade/renderer/texture/source/ShadeImage.js +74 -0
- package/src/shade/renderer/texture/source/ShadeTexelData.d.ts +78 -0
- package/src/shade/renderer/texture/source/ShadeTexelData.d.ts.map +1 -0
- package/src/shade/renderer/texture/source/ShadeTexelData.js +158 -0
- package/src/shade/renderer/texture/texture_descriptor_from_texture_shade.d.ts +0 -10
- package/src/shade/renderer/texture/texture_descriptor_from_texture_shade.d.ts.map +1 -1
- package/src/shade/renderer/texture/texture_descriptor_from_texture_shade.js +73 -175
- package/src/shade/renderer/texture/texture_write_level.d.ts +32 -0
- package/src/shade/renderer/texture/texture_write_level.d.ts.map +1 -0
- package/src/shade/renderer/texture/texture_write_level.js +77 -0
- package/src/shade/renderer/texture/texture_write_to_gpu.d.ts +8 -1
- package/src/shade/renderer/texture/texture_write_to_gpu.d.ts.map +1 -1
- package/src/shade/renderer/texture/texture_write_to_gpu.js +62 -37
- package/src/shade/renderer/texture/virtual/source/VTSourceImage.d.ts +8 -0
- package/src/shade/renderer/texture/virtual/source/VTSourceImage.d.ts.map +1 -1
- package/src/shade/renderer/texture/virtual/source/VTSourceImage.js +8 -0
- package/src/shade/util/texture_mip_extent.d.ts +49 -0
- package/src/shade/util/texture_mip_extent.d.ts.map +1 -0
- package/src/shade/util/texture_mip_extent.js +87 -0
- package/src/avif/native/isobmff/ByteCursor.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/codec/Codec.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/codec/CodecWithFallback.d.ts.map +0 -1
- package/src/shade/util/compute_max_mip_count.d.ts +0 -8
- package/src/shade/util/compute_max_mip_count.d.ts.map +0 -1
- package/src/shade/util/compute_max_mip_count.js +0 -27
- /package/src/engine/asset/{loaders/image/codec → codec}/Codec.d.ts +0 -0
- /package/src/engine/asset/{loaders/image/codec → codec}/Codec.js +0 -0
- /package/src/engine/asset/{loaders/image/codec → codec}/CodecWithFallback.d.ts +0 -0
|
@@ -1,156 +1,161 @@
|
|
|
1
|
-
import { assert } from "../../../core/assert.js";
|
|
2
|
-
import { array_copy } from "../../../core/collection/array/array_copy.js";
|
|
3
|
-
import { combine_hash } from "../../../core/collection/array/combine_hash.js";
|
|
4
|
-
import { isArrayEqualStrict } from "../../../core/collection/array/isArrayEqualStrict.js";
|
|
5
|
-
import { computeHashFloatArray } from "../../../core/math/hash/computeHashFloatArray.js";
|
|
6
|
-
import { computeStringHash } from "../../../core/primitives/strings/computeStringHash.js";
|
|
7
|
-
import {
|
|
8
|
-
ResourceDescriptor
|
|
9
|
-
} from "../../../engine/graphics/render/frame_graph/resource/ResourceDescriptor.js";
|
|
10
|
-
import {
|
|
11
|
-
import { decode_bitmask_enum } from "../decode_bitmask_enum.js";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
*
|
|
61
|
-
* @param {
|
|
62
|
-
* @param {
|
|
63
|
-
* @param {
|
|
64
|
-
* @param {
|
|
65
|
-
* @
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
assert.
|
|
77
|
-
assert.
|
|
78
|
-
assert.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
r.
|
|
84
|
-
r.
|
|
85
|
-
r.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
r
|
|
109
|
-
|
|
110
|
-
r.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
r.
|
|
114
|
-
r.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
r.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
&& this.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
2
|
+
import { array_copy } from "../../../core/collection/array/array_copy.js";
|
|
3
|
+
import { combine_hash } from "../../../core/collection/array/combine_hash.js";
|
|
4
|
+
import { isArrayEqualStrict } from "../../../core/collection/array/isArrayEqualStrict.js";
|
|
5
|
+
import { computeHashFloatArray } from "../../../core/math/hash/computeHashFloatArray.js";
|
|
6
|
+
import { computeStringHash } from "../../../core/primitives/strings/computeStringHash.js";
|
|
7
|
+
import {
|
|
8
|
+
ResourceDescriptor
|
|
9
|
+
} from "../../../engine/graphics/render/frame_graph/resource/ResourceDescriptor.js";
|
|
10
|
+
import { texture_mip_level_count } from "../../util/texture_mip_extent.js";
|
|
11
|
+
import { decode_bitmask_enum } from "../decode_bitmask_enum.js";
|
|
12
|
+
import { GPUTextureUsage } from "../../descriptor/GPUTextureUsage.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* **Vestigial.** Nothing branches on it — see {@link TextureResourceDescriptor.resolution_domain}.
|
|
16
|
+
*
|
|
17
|
+
* @enum {number}
|
|
18
|
+
*/
|
|
19
|
+
export const TextureResolutionDomain = {
|
|
20
|
+
Absolute: 0,
|
|
21
|
+
PresentationRelative: 1
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class TextureResourceDescriptor extends ResourceDescriptor {
|
|
25
|
+
/**
|
|
26
|
+
* **Vestigial. Do not read this to decide how to interpret {@link resolution}.**
|
|
27
|
+
*
|
|
28
|
+
* No code branches on it; only {@link hash} folds it in. {@link from} stores whatever
|
|
29
|
+
* resolution it is given without touching this field, and every caller gives it pixels — so a
|
|
30
|
+
* descriptor's resolution is absolute pixels whatever this says, including on the default
|
|
31
|
+
* `PresentationRelative` that {@link from} leaves in place.
|
|
32
|
+
*
|
|
33
|
+
* @type {TextureResolutionDomain|number}
|
|
34
|
+
*/
|
|
35
|
+
resolution_domain = TextureResolutionDomain.PresentationRelative;
|
|
36
|
+
|
|
37
|
+
// TODO use Uint32 instead
|
|
38
|
+
resolution = new Float64Array([1, 1, 1]);
|
|
39
|
+
sampleCount = 1;
|
|
40
|
+
|
|
41
|
+
mipLevelCount = 1;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @type {GPUTextureDimension|string}
|
|
46
|
+
*/
|
|
47
|
+
dimension = "2d"
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @type {string|GPUTextureFormat}
|
|
51
|
+
*/
|
|
52
|
+
format = "rgba8unorm";
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @type {number|GPUTextureUsageFlags}
|
|
56
|
+
*/
|
|
57
|
+
usage = GPUTextureUsage.TEXTURE_BINDING;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @param {number[]} resolution
|
|
62
|
+
* @param {GPUTextureDimension|string} [dimension]
|
|
63
|
+
* @param {GPUTextureFormat|string} format
|
|
64
|
+
* @param {GPUTextureUsageFlags|number} [usage]
|
|
65
|
+
* @param {boolean} [enableMips]
|
|
66
|
+
* @returns {TextureResourceDescriptor}
|
|
67
|
+
*/
|
|
68
|
+
static from({
|
|
69
|
+
resolution,
|
|
70
|
+
dimension = "2d",
|
|
71
|
+
format,
|
|
72
|
+
usage = GPUTextureUsage.TEXTURE_BINDING,
|
|
73
|
+
enableMips = false
|
|
74
|
+
}) {
|
|
75
|
+
|
|
76
|
+
assert.isString(format, 'format');
|
|
77
|
+
assert.defined(resolution, 'resolution');
|
|
78
|
+
assert.isArrayLike(resolution, 'resolution');
|
|
79
|
+
assert.isBoolean(enableMips, 'enableMips');
|
|
80
|
+
|
|
81
|
+
const r = new TextureResourceDescriptor();
|
|
82
|
+
|
|
83
|
+
array_copy(resolution, 0, r.resolution, 0, Math.min(r.resolution.length, resolution.length));
|
|
84
|
+
r.dimension = dimension;
|
|
85
|
+
r.format = format;
|
|
86
|
+
r.usage = usage;
|
|
87
|
+
|
|
88
|
+
if (enableMips === true) {
|
|
89
|
+
|
|
90
|
+
// `r.resolution` rather than the argument: it has already been padded to three, so a
|
|
91
|
+
// caller that gave two axes reads as depth 1 instead of `undefined`
|
|
92
|
+
r.mipLevelCount = texture_mip_level_count(
|
|
93
|
+
r.resolution[0], r.resolution[1], r.resolution[2], r.dimension
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return r;
|
|
99
|
+
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
*
|
|
104
|
+
* @param {GPUTexture} texture
|
|
105
|
+
* @returns {TextureResourceDescriptor}
|
|
106
|
+
*/
|
|
107
|
+
static fromTexture(texture) {
|
|
108
|
+
const r = new TextureResourceDescriptor();
|
|
109
|
+
|
|
110
|
+
r.format = texture.format;
|
|
111
|
+
r.dimension = texture.dimension;
|
|
112
|
+
|
|
113
|
+
r.usage = texture.usage;
|
|
114
|
+
r.sampleCount = texture.sampleCount;
|
|
115
|
+
r.resolution_domain = TextureResolutionDomain.Absolute;
|
|
116
|
+
|
|
117
|
+
r.resolution[0] = texture.width;
|
|
118
|
+
r.resolution[1] = texture.height;
|
|
119
|
+
r.resolution[2] = texture.depthOrArrayLayers;
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
r.mipLevelCount = texture.mipLevelCount;
|
|
123
|
+
|
|
124
|
+
return r;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
get type() {
|
|
128
|
+
return "texture";
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
hash() {
|
|
132
|
+
return combine_hash(
|
|
133
|
+
this.resolution_domain,
|
|
134
|
+
this.mipLevelCount,
|
|
135
|
+
computeHashFloatArray(this.resolution),
|
|
136
|
+
this.sampleCount,
|
|
137
|
+
this.usage,
|
|
138
|
+
computeStringHash(this.format)
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
*
|
|
144
|
+
* @param {TextureResourceDescriptor} other
|
|
145
|
+
* @returns {boolean}
|
|
146
|
+
*/
|
|
147
|
+
equals(other) {
|
|
148
|
+
return isArrayEqualStrict(this.resolution, other.resolution)
|
|
149
|
+
&& this.mipLevelCount === other.mipLevelCount
|
|
150
|
+
&& this.resolution_domain === other.resolution_domain
|
|
151
|
+
&& this.sampleCount === other.sampleCount
|
|
152
|
+
&& this.dimension === other.dimension
|
|
153
|
+
&& this.format === other.format
|
|
154
|
+
&& this.usage === other.usage
|
|
155
|
+
;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
toString() {
|
|
159
|
+
return `Texture{ resolution = [${this.resolution.join(",")}], mipLevelCount = ${this.mipLevelCount}, dimension = ${this.dimension}, format = ${this.format}, usage = ${decode_bitmask_enum(this.usage, GPUTextureUsage).join(' | ')}, sampleCount = ${this.sampleCount} }`;
|
|
160
|
+
}
|
|
156
161
|
}
|
|
@@ -19,10 +19,17 @@ export class SoftwareGPUQueue implements GPUQueue {
|
|
|
19
19
|
*/
|
|
20
20
|
writeBuffer(buffer: GPUBuffer, bufferOffset: number, data: BufferSource, dataOffset?: number, size?: number): void;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* Emulates {@link GPUQueue#writeTexture}: copies rows of texel blocks from a BufferSource into
|
|
23
|
+
* the destination mip's lazily-allocated storage.
|
|
24
|
+
*
|
|
25
|
+
* The same operation as {@link SoftwareGPUCommandEncoder#copyBufferToTexture} with the bytes
|
|
26
|
+
* supplied inline rather than through a `GPUBuffer`, and it runs on the same two functions —
|
|
27
|
+
* which is what makes it block-aware, multi-layer and `rowsPerImage`-honouring rather than the
|
|
28
|
+
* 2D single-layer `bytes_per_texel` subset it used to be. A BC7 write is not a special case here;
|
|
29
|
+
* it is the same row loop over a row that happens to be four texels tall.
|
|
30
|
+
*
|
|
31
|
+
* `dataLayout.offset` is in bytes (spec), `bytesPerRow` defaults to a tightly packed row of
|
|
32
|
+
* blocks.
|
|
26
33
|
*
|
|
27
34
|
* @param {GPUTexelCopyTextureInfo} destination
|
|
28
35
|
* @param {BufferSource} data
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SoftwareGPUQueue.d.ts","sourceRoot":"","sources":["../../../../../src/shade/device/mock/SoftwareGPUQueue.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SoftwareGPUQueue.d.ts","sourceRoot":"","sources":["../../../../../src/shade/device/mock/SoftwareGPUQueue.js"],"names":[],"mappings":"AA4DA;;;GAGG;AACH,yCAFgB,QAAQ;IAYpB;;OAEG;IACH,uCAEC;IAoDD;;;;;;;;;OASG;IACH,6CALW,MAAM,QACN,YAAY,eACZ,MAAM,SACN,MAAM,QA6ChB;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,yDAJW,YAAY,iEAmCtB;IAED;;;;;;;;;;;;;OAaG;IACH,2IAmEC;IAED;;;OAGG;IACH,uBAFW,0BAA0B,QA0BpC;IAED;;;;;;OAMG;IACH,uBAFa,QAAQ,SAAS,CAAC,CAI9B;;CACJ"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { assert } from "../../../core/assert.js";
|
|
2
2
|
import { array_buffer_copy } from "../../../core/collection/array/typed/array_buffer_copy.js";
|
|
3
|
+
import { texture_copy_execute, texture_copy_refusal } from "./texture_copy.js";
|
|
3
4
|
import { SoftwareGPUValidationError } from "./SoftwareGPUError.js";
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -184,10 +185,17 @@ export class SoftwareGPUQueue {
|
|
|
184
185
|
}
|
|
185
186
|
|
|
186
187
|
/**
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
188
|
+
* Emulates {@link GPUQueue#writeTexture}: copies rows of texel blocks from a BufferSource into
|
|
189
|
+
* the destination mip's lazily-allocated storage.
|
|
190
|
+
*
|
|
191
|
+
* The same operation as {@link SoftwareGPUCommandEncoder#copyBufferToTexture} with the bytes
|
|
192
|
+
* supplied inline rather than through a `GPUBuffer`, and it runs on the same two functions —
|
|
193
|
+
* which is what makes it block-aware, multi-layer and `rowsPerImage`-honouring rather than the
|
|
194
|
+
* 2D single-layer `bytes_per_texel` subset it used to be. A BC7 write is not a special case here;
|
|
195
|
+
* it is the same row loop over a row that happens to be four texels tall.
|
|
196
|
+
*
|
|
197
|
+
* `dataLayout.offset` is in bytes (spec), `bytesPerRow` defaults to a tightly packed row of
|
|
198
|
+
* blocks.
|
|
191
199
|
*
|
|
192
200
|
* @param {GPUTexelCopyTextureInfo} destination
|
|
193
201
|
* @param {BufferSource} data
|
|
@@ -199,46 +207,32 @@ export class SoftwareGPUQueue {
|
|
|
199
207
|
|
|
200
208
|
assert.equal(texture.isSoftwareGPUTexture, true, 'texture.isSoftwareGPUTexture !== true');
|
|
201
209
|
|
|
202
|
-
|
|
210
|
+
/*
|
|
211
|
+
The destination half of a copy's validation, which is a superset of what this used to check
|
|
212
|
+
for itself: the same invalid/destroyed/COPY_DST refusals, and additionally a format WebGPU
|
|
213
|
+
forbids copies of, a mip outside the chain, and a region past the edge of it.
|
|
214
|
+
*/
|
|
215
|
+
const refusal = texture_copy_refusal({ texture_destination: destination, size });
|
|
203
216
|
|
|
204
|
-
if (
|
|
205
|
-
this.#device.generate_error(new SoftwareGPUValidationError(`writeTexture: ${
|
|
217
|
+
if (refusal !== null) {
|
|
218
|
+
this.#device.generate_error(new SoftwareGPUValidationError(`writeTexture: ${refusal}`));
|
|
206
219
|
|
|
207
220
|
return;
|
|
208
221
|
}
|
|
209
222
|
|
|
210
|
-
const width = size.width ?? size[0] ?? 1;
|
|
211
|
-
const height = size.height ?? size[1] ?? 1;
|
|
212
|
-
const depth = size.depthOrArrayLayers ?? size[2] ?? 1;
|
|
213
|
-
|
|
214
|
-
assert.equal(depth, 1, 'only single-layer writes are emulated');
|
|
215
|
-
|
|
216
|
-
const mip = destination.mipLevel ?? 0;
|
|
217
|
-
const origin_x = destination.origin?.x ?? destination.origin?.[0] ?? 0;
|
|
218
|
-
const origin_y = destination.origin?.y ?? destination.origin?.[1] ?? 0;
|
|
219
|
-
|
|
220
|
-
const bytes_per_texel = texture.bytes_per_texel;
|
|
221
|
-
|
|
222
223
|
const source = normalize_buffer_source(data);
|
|
223
224
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
source.buffer,
|
|
236
|
-
source_offset + row * bytes_per_row,
|
|
237
|
-
mip_data,
|
|
238
|
-
(origin_y + row) * dst_stride + origin_x * bytes_per_texel,
|
|
239
|
-
width * bytes_per_texel
|
|
240
|
-
);
|
|
241
|
-
}
|
|
225
|
+
texture_copy_execute({
|
|
226
|
+
buffer_source: {
|
|
227
|
+
// the inline bytes, in the shape the buffer endpoint reads
|
|
228
|
+
buffer: { data: source.buffer },
|
|
229
|
+
offset: source.byteOffset + (dataLayout?.offset ?? 0),
|
|
230
|
+
bytesPerRow: dataLayout?.bytesPerRow,
|
|
231
|
+
rowsPerImage: dataLayout?.rowsPerImage,
|
|
232
|
+
},
|
|
233
|
+
texture_destination: destination,
|
|
234
|
+
size,
|
|
235
|
+
});
|
|
242
236
|
}
|
|
243
237
|
|
|
244
238
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SoftwareGPUTexture.d.ts","sourceRoot":"","sources":["../../../../../src/shade/device/mock/SoftwareGPUTexture.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SoftwareGPUTexture.d.ts","sourceRoot":"","sources":["../../../../../src/shade/device/mock/SoftwareGPUTexture.js"],"names":[],"mappings":"AAWA;;;;;;;;;GASG;AACH,yEAFgB,UAAU;IA+CtB;;;;;OAKG;IACH,kDAFa,kBAAkB,CAI9B;IA/BD;;;OAGG;IACH,sDAFW,OAAO,EAmBjB;IAtCD;;;;;;OAMG;IACH,uBAEC;IAoBG,WAAuC;IACvC,YAAyC;IACzC,wBAAiE;IAEjE,YAA+B;IAC/B,eAA6C;IAC7C,WAA6B;IAC7B,iBAA8C;IAC9C,mBAAkD;IAatD;;OAEG;IACH,2BAEC;IAED;;;;OAIG;IACH,wCAEC;IAED;;;;;;;;;OASG;IACH,8BAUC;IAED;;;OAGG;IACH,eAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,gBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;OAMG;IACH,gBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;OAMG;IACH,gBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;OAKG;IACH,kBAHW,MAAM,GACJ,MAAM,CAKlB;IAED;;;;;;OAMG;IACH,mBAHW,MAAM,GACJ,WAAW,CAgBvB;IAED;;;OAGG;IACH,kEAMC;IAED;;;OAGG;IACH,gBAOC;IAGL;;;OAGG;IACH,+BAFU,OAAO,CAEgC;;CANhD;sCA1MqC,4BAA4B"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
gpu_texture_format_info,
|
|
3
|
+
gpu_texture_format_is_block_compressed,
|
|
4
|
+
gpu_texture_format_level_bytes,
|
|
3
5
|
gpu_texture_format_row_bytes,
|
|
4
6
|
gpu_texture_format_row_count
|
|
5
7
|
} from "../../descriptor/texture/format/gpu_texture_format_info.js";
|
|
8
|
+
import { texture_mip_size } from "../../util/texture_mip_extent.js";
|
|
6
9
|
import { SoftwareGPUObjectBase } from "./SoftwareGPUObjectBase.js";
|
|
7
10
|
import { SoftwareGPUTextureView } from "./SoftwareGPUTextureView.js";
|
|
8
11
|
|
|
@@ -100,7 +103,7 @@ export class SoftwareGPUTexture extends SoftwareGPUObjectBase {
|
|
|
100
103
|
get bytes_per_texel() {
|
|
101
104
|
const info = this.format_info;
|
|
102
105
|
|
|
103
|
-
if (
|
|
106
|
+
if (gpu_texture_format_is_block_compressed(this.format)) {
|
|
104
107
|
throw new Error(
|
|
105
108
|
`bytes_per_texel: '${this.format}' is block-compressed (${info.block_width}x${info.block_height}), use row_bytes instead`
|
|
106
109
|
);
|
|
@@ -114,7 +117,7 @@ export class SoftwareGPUTexture extends SoftwareGPUObjectBase {
|
|
|
114
117
|
* @returns {number}
|
|
115
118
|
*/
|
|
116
119
|
mip_width(mip) {
|
|
117
|
-
return
|
|
120
|
+
return texture_mip_size(this.width, mip);
|
|
118
121
|
}
|
|
119
122
|
|
|
120
123
|
/**
|
|
@@ -122,7 +125,7 @@ export class SoftwareGPUTexture extends SoftwareGPUObjectBase {
|
|
|
122
125
|
* @returns {number}
|
|
123
126
|
*/
|
|
124
127
|
mip_height(mip) {
|
|
125
|
-
return
|
|
128
|
+
return texture_mip_size(this.height, mip);
|
|
126
129
|
}
|
|
127
130
|
|
|
128
131
|
/**
|
|
@@ -154,7 +157,8 @@ export class SoftwareGPUTexture extends SoftwareGPUObjectBase {
|
|
|
154
157
|
* @returns {number}
|
|
155
158
|
*/
|
|
156
159
|
layer_bytes(mip = 0) {
|
|
157
|
-
|
|
160
|
+
// one layer, hence the 1 — get_mip_data multiplies by depthOrArrayLayers itself
|
|
161
|
+
return gpu_texture_format_level_bytes(this.format, this.mip_width(mip), this.mip_height(mip), 1);
|
|
158
162
|
}
|
|
159
163
|
|
|
160
164
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame_graph_extract_topology.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/device/timing/profile/frame_graph_extract_topology.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"frame_graph_extract_topology.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/device/timing/profile/frame_graph_extract_topology.js"],"names":[],"mappings":"AAqCA;;;;;;;;;;;;;;;;GAgBG;AACH,iEALa,kBAAkB,CAkH9B;mCA3JM,yBAAyB"}
|