@nuflo/engine 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/nf_wasm.d.ts +656 -0
- package/nf_wasm.js +2864 -0
- package/nf_wasm_bg.wasm +0 -0
- package/package.json +20 -0
package/nf_wasm.js
ADDED
|
@@ -0,0 +1,2864 @@
|
|
|
1
|
+
/* @ts-self-types="./nf_wasm.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The graph engine exposed to JavaScript.
|
|
5
|
+
*/
|
|
6
|
+
export class Engine {
|
|
7
|
+
__destroy_into_raw() {
|
|
8
|
+
const ptr = this.__wbg_ptr;
|
|
9
|
+
this.__wbg_ptr = 0;
|
|
10
|
+
EngineFinalization.unregister(this);
|
|
11
|
+
return ptr;
|
|
12
|
+
}
|
|
13
|
+
free() {
|
|
14
|
+
const ptr = this.__destroy_into_raw();
|
|
15
|
+
wasm.__wbg_engine_free(ptr, 0);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Number of assets currently resolved (for diagnostics / the host loader).
|
|
19
|
+
* @returns {number}
|
|
20
|
+
*/
|
|
21
|
+
asset_count() {
|
|
22
|
+
const ret = wasm.engine_asset_count(this.__wbg_ptr);
|
|
23
|
+
return ret >>> 0;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Keyframe-bake the current scene along the scroll axis (#4): evaluate the graph at
|
|
27
|
+
* `samples` scroll positions and store the geometry so `tick` interpolates it instead
|
|
28
|
+
* of re-evaluating the graph every frame ("bake the function"). Returns `false` (no
|
|
29
|
+
* bake) when there's no document, no mesh, or the topology changes across scroll.
|
|
30
|
+
* PRECONDITION: lighting/camera/materials must be static (only geometry animates
|
|
31
|
+
* along scroll) — the bake captures the render config once at scroll 0.
|
|
32
|
+
* @param {number} samples
|
|
33
|
+
* @returns {boolean}
|
|
34
|
+
*/
|
|
35
|
+
bake_scroll(samples) {
|
|
36
|
+
const ret = wasm.engine_bake_scroll(this.__wbg_ptr, samples);
|
|
37
|
+
return ret !== 0;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The active scene camera as a flat float array for
|
|
41
|
+
* [`Viewport::set_scene_camera`](crate::Viewport::set_scene_camera):
|
|
42
|
+
* `[eye.xyz(3), target.xyz(3), up.xyz(3), fov_y_deg, projection(0 persp/1 ortho),
|
|
43
|
+
* ortho_height, znear, zfar]` (14 floats).
|
|
44
|
+
*
|
|
45
|
+
* When no `camera` node ran this returns `SceneCamera::default()` — the framing
|
|
46
|
+
* the editor viewport hardcoded before the camera became a node — so existing
|
|
47
|
+
* scenes look unchanged.
|
|
48
|
+
* @returns {Float32Array}
|
|
49
|
+
*/
|
|
50
|
+
camera() {
|
|
51
|
+
const ret = wasm.engine_camera(this.__wbg_ptr);
|
|
52
|
+
var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
|
|
53
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
54
|
+
return v1;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* `[view_proj | inverse(view_proj)]` (32 column-major f32) for the live editor
|
|
58
|
+
* camera, built with the renderer's own [`nf_render::Camera`] so editor
|
|
59
|
+
* overlays project against the EXACT matrix the renderer draws with (no TS
|
|
60
|
+
* re-derivation of the camera math — the source of the old +Y/+Z drift).
|
|
61
|
+
* `cam` is the flat camera ABI ([`Engine::camera`] layout); `aspect` = w/h.
|
|
62
|
+
* @param {Float32Array} cam
|
|
63
|
+
* @param {number} aspect
|
|
64
|
+
* @returns {Float32Array}
|
|
65
|
+
*/
|
|
66
|
+
camera_matrices(cam, aspect) {
|
|
67
|
+
const ptr0 = passArrayF32ToWasm0(cam, wasm.__wbindgen_malloc);
|
|
68
|
+
const len0 = WASM_VECTOR_LEN;
|
|
69
|
+
const ret = wasm.engine_camera_matrices(this.__wbg_ptr, ptr0, len0, aspect);
|
|
70
|
+
var v2 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
|
|
71
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
72
|
+
return v2;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The node catalog as a JSON array of node definitions, for the editor
|
|
76
|
+
* palette and the AI layer. Serialization of the catalog cannot realistically
|
|
77
|
+
* fail; on the off chance it does we return an empty JSON array.
|
|
78
|
+
* @returns {string}
|
|
79
|
+
*/
|
|
80
|
+
catalog() {
|
|
81
|
+
let deferred1_0;
|
|
82
|
+
let deferred1_1;
|
|
83
|
+
try {
|
|
84
|
+
const ret = wasm.engine_catalog(this.__wbg_ptr);
|
|
85
|
+
deferred1_0 = ret[0];
|
|
86
|
+
deferred1_1 = ret[1];
|
|
87
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
88
|
+
} finally {
|
|
89
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Drop every provided asset. The host calls this when switching to an
|
|
94
|
+
* unrelated scene; document edits do NOT need it (handles are content-stable).
|
|
95
|
+
*/
|
|
96
|
+
clear_assets() {
|
|
97
|
+
wasm.engine_clear_assets(this.__wbg_ptr);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Drop the scroll bake; `tick` returns to live graph evaluation.
|
|
101
|
+
*/
|
|
102
|
+
clear_bake() {
|
|
103
|
+
wasm.engine_clear_bake(this.__wbg_ptr);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Drop a host-injected external signal by name. Subsequent reads on
|
|
107
|
+
* nodes referencing `name` fall back to their literal default.
|
|
108
|
+
* @param {string} name
|
|
109
|
+
*/
|
|
110
|
+
clear_external_signal(name) {
|
|
111
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
112
|
+
const len0 = WASM_VECTOR_LEN;
|
|
113
|
+
wasm.engine_clear_external_signal(this.__wbg_ptr, ptr0, len0);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Flattened `r, g, b, a` per-vertex linear colors of the cached mesh, read
|
|
117
|
+
* from the `color` point attribute (empty if absent or not vertex-aligned).
|
|
118
|
+
* This is the glTF `COLOR_0` channel: an imported `.glb`'s vertex colors land
|
|
119
|
+
* here and survive a re-export. Returned to JS as a `Float32Array`.
|
|
120
|
+
* @returns {Float32Array}
|
|
121
|
+
*/
|
|
122
|
+
colors() {
|
|
123
|
+
const ret = wasm.engine_colors(this.__wbg_ptr);
|
|
124
|
+
var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
|
|
125
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
126
|
+
return v1;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Flattened `r, g, b, a` per-vertex HDR emission colors of the cached mesh
|
|
130
|
+
* (empty if no point-domain emission attribute is present).
|
|
131
|
+
* @returns {Float32Array}
|
|
132
|
+
*/
|
|
133
|
+
emissions() {
|
|
134
|
+
const ret = wasm.engine_emissions(this.__wbg_ptr);
|
|
135
|
+
var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
|
|
136
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
137
|
+
return v1;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The most recently evaluated environment as a flat float array for
|
|
141
|
+
* [`Viewport::set_environment`](crate::Viewport::set_environment):
|
|
142
|
+
* `[floor_rgb(3), zenith_rgb(3), intensity(1), softbox_count(1),
|
|
143
|
+
* fog_color_rgb(3), fog_near(1), fog_far(1), fog_density(1), fog_mode(1),
|
|
144
|
+
* bg_rgba(4), bg_enabled(1), then per softbox: dir_xyz(3), color_rgb(3),
|
|
145
|
+
* sharpness(1)]` (20-float header).
|
|
146
|
+
* Prefers an `environment` node's value; falls back to the evaluated `LookSpec`
|
|
147
|
+
* environment when the graph has none. Disabled softboxes are already dropped.
|
|
148
|
+
* @returns {Float32Array}
|
|
149
|
+
*/
|
|
150
|
+
environment() {
|
|
151
|
+
const ret = wasm.engine_environment(this.__wbg_ptr);
|
|
152
|
+
var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
|
|
153
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
154
|
+
return v1;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Parse and evaluate a [`GraphDocument`] (as JSON), caching the resulting
|
|
158
|
+
* geometry for the buffer accessors.
|
|
159
|
+
*
|
|
160
|
+
* Returns a JSON status string and never panics on bad input:
|
|
161
|
+
* - success: `{"ok":true,"verts":N,"faces":M,"tris":T}`
|
|
162
|
+
* - parse/eval failure: `{"ok":false,"error":"<message>"}`
|
|
163
|
+
* @param {string} document_json
|
|
164
|
+
* @returns {string}
|
|
165
|
+
*/
|
|
166
|
+
evaluate(document_json) {
|
|
167
|
+
let deferred2_0;
|
|
168
|
+
let deferred2_1;
|
|
169
|
+
try {
|
|
170
|
+
const ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
171
|
+
const len0 = WASM_VECTOR_LEN;
|
|
172
|
+
const ret = wasm.engine_evaluate(this.__wbg_ptr, ptr0, len0);
|
|
173
|
+
deferred2_0 = ret[0];
|
|
174
|
+
deferred2_1 = ret[1];
|
|
175
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
176
|
+
} finally {
|
|
177
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Current host-injected external signals as a typed JSON array, for the
|
|
182
|
+
* inspector's live-values panel. Each entry: `{kind, name, value}`. `value`
|
|
183
|
+
* shape varies by kind (number for float, bool for bool, `[x,y,z]` for vec3).
|
|
184
|
+
* Inline-typed so we can carry the kind tag without `serde_json::Value`.
|
|
185
|
+
* @returns {string}
|
|
186
|
+
*/
|
|
187
|
+
external_signals_json() {
|
|
188
|
+
let deferred1_0;
|
|
189
|
+
let deferred1_1;
|
|
190
|
+
try {
|
|
191
|
+
const ret = wasm.engine_external_signals_json(this.__wbg_ptr);
|
|
192
|
+
deferred1_0 = ret[0];
|
|
193
|
+
deferred1_1 = ret[1];
|
|
194
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
195
|
+
} finally {
|
|
196
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Per-TRIANGLE source-node indices of the cached mesh, aligned 1:1 with the
|
|
201
|
+
* triangles emitted by [`Engine::indices`] (`indices().len() / 3` entries). Each
|
|
202
|
+
* value indexes [`Engine::source_node_ids`]; the sentinel `u32::MAX` means "no
|
|
203
|
+
* node". Empty if there is no cached mesh. Returned to JS as a `Uint32Array`.
|
|
204
|
+
* @returns {Uint32Array}
|
|
205
|
+
*/
|
|
206
|
+
face_source_nodes() {
|
|
207
|
+
const ret = wasm.engine_face_source_nodes(this.__wbg_ptr);
|
|
208
|
+
var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
209
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
210
|
+
return v1;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Read a boolean state variable (false if unset).
|
|
214
|
+
* @param {string} name
|
|
215
|
+
* @returns {boolean}
|
|
216
|
+
*/
|
|
217
|
+
get_var_bool(name) {
|
|
218
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
219
|
+
const len0 = WASM_VECTOR_LEN;
|
|
220
|
+
const ret = wasm.engine_get_var_bool(this.__wbg_ptr, ptr0, len0);
|
|
221
|
+
return ret !== 0;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Read a color state variable as `[r, g, b, a]` (opaque black if unset).
|
|
225
|
+
* @param {string} name
|
|
226
|
+
* @returns {Float32Array}
|
|
227
|
+
*/
|
|
228
|
+
get_var_color(name) {
|
|
229
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
230
|
+
const len0 = WASM_VECTOR_LEN;
|
|
231
|
+
const ret = wasm.engine_get_var_color(this.__wbg_ptr, ptr0, len0);
|
|
232
|
+
var v2 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
|
|
233
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
234
|
+
return v2;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Read a numeric state variable (0.0 if unset).
|
|
238
|
+
* @param {string} name
|
|
239
|
+
* @returns {number}
|
|
240
|
+
*/
|
|
241
|
+
get_var_number(name) {
|
|
242
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
243
|
+
const len0 = WASM_VECTOR_LEN;
|
|
244
|
+
const ret = wasm.engine_get_var_number(this.__wbg_ptr, ptr0, len0);
|
|
245
|
+
return ret;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Read a vector state variable as `[x, y, z]` (zeros if unset). This is the
|
|
249
|
+
* host→3D binding path for positions/rotations/scales.
|
|
250
|
+
* @param {string} name
|
|
251
|
+
* @returns {Float32Array}
|
|
252
|
+
*/
|
|
253
|
+
get_var_vector(name) {
|
|
254
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
255
|
+
const len0 = WASM_VECTOR_LEN;
|
|
256
|
+
const ret = wasm.engine_get_var_vector(this.__wbg_ptr, ptr0, len0);
|
|
257
|
+
var v2 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
|
|
258
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
259
|
+
return v2;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* The cached GPU-SDF field's compiled-shader description, as the strings/floats
|
|
263
|
+
* the viewport reconstructs a render request from (the `Field` itself can't
|
|
264
|
+
* cross the JS boundary). Layout:
|
|
265
|
+
* `[result_type, needs_noise, needs_op_lib, center_x, center_y, center_z, size,
|
|
266
|
+
* resolution]` (all `f32`; booleans are 0/1, `resolution` rounds to `u32`),
|
|
267
|
+
* returned alongside the WGSL `body`/`result` strings via
|
|
268
|
+
* [`Engine::gpu_sdf_program_body`]/[`Engine::gpu_sdf_program_result`]. Empty if
|
|
269
|
+
* there is no `gpu_sdf` or its field doesn't compile to WGSL.
|
|
270
|
+
* @returns {Float32Array}
|
|
271
|
+
*/
|
|
272
|
+
gpu_sdf_descriptor() {
|
|
273
|
+
const ret = wasm.engine_gpu_sdf_descriptor(this.__wbg_ptr);
|
|
274
|
+
var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
|
|
275
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
276
|
+
return v1;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* The WGSL `body` (SSA statements) of the cached GPU-SDF field's compiled
|
|
280
|
+
* program; empty if there is no `gpu_sdf` or it doesn't compile.
|
|
281
|
+
* @returns {string}
|
|
282
|
+
*/
|
|
283
|
+
gpu_sdf_program_body() {
|
|
284
|
+
let deferred1_0;
|
|
285
|
+
let deferred1_1;
|
|
286
|
+
try {
|
|
287
|
+
const ret = wasm.engine_gpu_sdf_program_body(this.__wbg_ptr);
|
|
288
|
+
deferred1_0 = ret[0];
|
|
289
|
+
deferred1_1 = ret[1];
|
|
290
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
291
|
+
} finally {
|
|
292
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* The WGSL `result` expression of the cached GPU-SDF field's compiled program;
|
|
297
|
+
* empty if there is no `gpu_sdf` or it doesn't compile.
|
|
298
|
+
* @returns {string}
|
|
299
|
+
*/
|
|
300
|
+
gpu_sdf_program_result() {
|
|
301
|
+
let deferred1_0;
|
|
302
|
+
let deferred1_1;
|
|
303
|
+
try {
|
|
304
|
+
const ret = wasm.engine_gpu_sdf_program_result(this.__wbg_ptr);
|
|
305
|
+
deferred1_0 = ret[0];
|
|
306
|
+
deferred1_1 = ret[1];
|
|
307
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
308
|
+
} finally {
|
|
309
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* The most recent `tick`'s signals (8 floats, `SignalKind` order) for the
|
|
314
|
+
* GPU-SDF density shader's uniform, so the field animates per frame.
|
|
315
|
+
* @returns {Float32Array}
|
|
316
|
+
*/
|
|
317
|
+
gpu_sdf_signals() {
|
|
318
|
+
const ret = wasm.engine_gpu_sdf_signals(this.__wbg_ptr);
|
|
319
|
+
var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
|
|
320
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
321
|
+
return v1;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Whether the cached geometry carries a GPU-polygonized SDF (`sdf_to_mesh` in
|
|
325
|
+
* GPU mode). When true, the frontend should drive the viewport's GPU-SDF glass
|
|
326
|
+
* path (`render_gpu_sdf`) instead of `set_mesh` — the field is polygonized on
|
|
327
|
+
* the GPU every frame rather than carried as a CPU mesh.
|
|
328
|
+
* @returns {boolean}
|
|
329
|
+
*/
|
|
330
|
+
has_gpu_sdf() {
|
|
331
|
+
const ret = wasm.engine_has_gpu_sdf(this.__wbg_ptr);
|
|
332
|
+
return ret !== 0;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Triangulated triangle indices of the cached mesh (empty if none).
|
|
336
|
+
* Returned to JS as a `Uint32Array`.
|
|
337
|
+
* @returns {Uint32Array}
|
|
338
|
+
*/
|
|
339
|
+
indices() {
|
|
340
|
+
const ret = wasm.engine_indices(this.__wbg_ptr);
|
|
341
|
+
var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
342
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
343
|
+
return v1;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Whether a scroll bake is currently active.
|
|
347
|
+
* @returns {boolean}
|
|
348
|
+
*/
|
|
349
|
+
is_baked() {
|
|
350
|
+
const ret = wasm.engine_is_baked(this.__wbg_ptr);
|
|
351
|
+
return ret !== 0;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* The scene lights from the most recent evaluation, flattened to
|
|
355
|
+
* [`LIGHT_STRIDE`] floats each for
|
|
356
|
+
* [`Viewport::set_lights`](crate::Viewport::set_lights):
|
|
357
|
+
* `[kind(0 dir/1 point/2 spot), pos.x,pos.y,pos.z, dir.x,dir.y,dir.z,
|
|
358
|
+
* color.r,color.g,color.b, intensity, range, cos_inner, cos_outer]`.
|
|
359
|
+
*
|
|
360
|
+
* When the graph emitted no light nodes the array is a single default
|
|
361
|
+
* directional light (a soft key from above-front) so lightless scenes still
|
|
362
|
+
* render instead of going black. The frontend infers the light count as
|
|
363
|
+
* `len / LIGHT_STRIDE`.
|
|
364
|
+
* @returns {Float32Array}
|
|
365
|
+
*/
|
|
366
|
+
lights_flat() {
|
|
367
|
+
const ret = wasm.engine_lights_flat(this.__wbg_ptr);
|
|
368
|
+
var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
|
|
369
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
370
|
+
return v1;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Load a `scene.wasm` (or its raw `nf-scene` section payload): decode the
|
|
374
|
+
* bundle, install the document, register any Embedded assets into the store,
|
|
375
|
+
* and return a JSON status listing the External assets the host must still
|
|
376
|
+
* fetch and `provide_asset`. Shape:
|
|
377
|
+
* `{"ok":true,"external":[{"handle","mime","sha256","url"}]}` or
|
|
378
|
+
* `{"ok":false,"error":...}`.
|
|
379
|
+
* @param {Uint8Array} scene_wasm
|
|
380
|
+
* @returns {string}
|
|
381
|
+
*/
|
|
382
|
+
load_scene_wasm(scene_wasm) {
|
|
383
|
+
let deferred2_0;
|
|
384
|
+
let deferred2_1;
|
|
385
|
+
try {
|
|
386
|
+
const ptr0 = passArray8ToWasm0(scene_wasm, wasm.__wbindgen_malloc);
|
|
387
|
+
const len0 = WASM_VECTOR_LEN;
|
|
388
|
+
const ret = wasm.engine_load_scene_wasm(this.__wbg_ptr, ptr0, len0);
|
|
389
|
+
deferred2_0 = ret[0];
|
|
390
|
+
deferred2_1 = ret[1];
|
|
391
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
392
|
+
} finally {
|
|
393
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* The cached geometry's PBR material as the full 32-float ABI documented on
|
|
398
|
+
* [`nf_core::geometry::Material::from_engine_slice`]: the 24-float core
|
|
399
|
+
* (`base_color.rgba`, metallic, roughness, emission, iridescence, matcap,
|
|
400
|
+
* texture controls, map strengths, video_texture_mix) followed by the glass
|
|
401
|
+
* block `[transmission, ior, thickness, attenuation_color.rgb,
|
|
402
|
+
* attenuation_distance, dispersion]`. `Viewport::set_material` and the GLB
|
|
403
|
+
* exporter decode it with the same constructor. Defaults if no geometry yet.
|
|
404
|
+
* @returns {Float32Array}
|
|
405
|
+
*/
|
|
406
|
+
material() {
|
|
407
|
+
const ret = wasm.engine_material(this.__wbg_ptr);
|
|
408
|
+
var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
|
|
409
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
410
|
+
return v1;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Build an engine with all built-in node types registered.
|
|
414
|
+
*/
|
|
415
|
+
constructor() {
|
|
416
|
+
const ret = wasm.engine_new();
|
|
417
|
+
this.__wbg_ptr = ret;
|
|
418
|
+
EngineFinalization.register(this, this.__wbg_ptr, this);
|
|
419
|
+
return this;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Flattened `x, y, z` vertex normals of the cached mesh (empty if none).
|
|
423
|
+
* Returned to JS as a `Float32Array`.
|
|
424
|
+
* @returns {Float32Array}
|
|
425
|
+
*/
|
|
426
|
+
normals() {
|
|
427
|
+
const ret = wasm.engine_normals(this.__wbg_ptr);
|
|
428
|
+
var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
|
|
429
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
430
|
+
return v1;
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Export the current document as a `scene.wasm`: the graph (MessagePack) plus
|
|
434
|
+
* an asset table baked into the `nf-scene` custom section. `embedded` selects
|
|
435
|
+
* the asset mode:
|
|
436
|
+
* - `true` — every provided asset's bytes ride inside the section (a single
|
|
437
|
+
* self-contained download; re-ships on every edit, no cross-scene dedup).
|
|
438
|
+
* - `false` — only a content-addressed manifest rides in the section (handle,
|
|
439
|
+
* MIME, sha256); the bytes are fetched separately at load (cached, shared,
|
|
440
|
+
* parallel). The host hosts the bytes by sha256 / the loader's configured base.
|
|
441
|
+
*
|
|
442
|
+
* Returns the `scene.wasm` bytes, or an error if no document is loaded.
|
|
443
|
+
* @param {boolean} embedded
|
|
444
|
+
* @returns {Uint8Array}
|
|
445
|
+
*/
|
|
446
|
+
pack_scene_wasm(embedded) {
|
|
447
|
+
const ret = wasm.engine_pack_scene_wasm(this.__wbg_ptr, embedded);
|
|
448
|
+
if (ret[3]) {
|
|
449
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
450
|
+
}
|
|
451
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
452
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
453
|
+
return v1;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Drain the host-bound runtime actions queued since the last call,
|
|
457
|
+
* returning them as a JSON array of tagged objects (the same shape as
|
|
458
|
+
* [`RuntimeAction`]'s `#[serde(tag = "kind")]` representation). The
|
|
459
|
+
* frontend parses this once per frame as a typed discriminated union
|
|
460
|
+
* (`{ kind: "open_link", url, new_tab } | { kind: "play_sound", ... }
|
|
461
|
+
* | ...`) and dispatches each intent to its host handler.
|
|
462
|
+
*
|
|
463
|
+
* Engine-local intents (variable resets) are dispatched inside `tick`
|
|
464
|
+
* and never appear here. Calling this method clears the queue, so back-
|
|
465
|
+
* to-back calls in the same frame will return `[]` for the second one.
|
|
466
|
+
* @returns {string}
|
|
467
|
+
*/
|
|
468
|
+
pending_actions_json() {
|
|
469
|
+
let deferred1_0;
|
|
470
|
+
let deferred1_1;
|
|
471
|
+
try {
|
|
472
|
+
const ret = wasm.engine_pending_actions_json(this.__wbg_ptr);
|
|
473
|
+
deferred1_0 = ret[0];
|
|
474
|
+
deferred1_1 = ret[1];
|
|
475
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
476
|
+
} finally {
|
|
477
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* The source-node id of the geometry under a viewport point, or `None` on a
|
|
482
|
+
* miss. `ndc_x`/`ndc_y` are normalized device coords in `[-1, 1]` (+Y up).
|
|
483
|
+
* Raycasts the cached mesh (Möller–Trumbore) using a ray unprojected from the
|
|
484
|
+
* live camera — the picking compute lives here in Rust, not TS.
|
|
485
|
+
* @param {Float32Array} cam
|
|
486
|
+
* @param {number} aspect
|
|
487
|
+
* @param {number} ndc_x
|
|
488
|
+
* @param {number} ndc_y
|
|
489
|
+
* @returns {string | undefined}
|
|
490
|
+
*/
|
|
491
|
+
pick(cam, aspect, ndc_x, ndc_y) {
|
|
492
|
+
const ptr0 = passArrayF32ToWasm0(cam, wasm.__wbindgen_malloc);
|
|
493
|
+
const len0 = WASM_VECTOR_LEN;
|
|
494
|
+
const ret = wasm.engine_pick(this.__wbg_ptr, ptr0, len0, aspect, ndc_x, ndc_y);
|
|
495
|
+
let v2;
|
|
496
|
+
if (ret[0] !== 0) {
|
|
497
|
+
v2 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
498
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
499
|
+
}
|
|
500
|
+
return v2;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Source-node ids whose geometry falls inside a screen-rect marquee (NDC, +Y
|
|
504
|
+
* up). A node is included when any of its triangles' centroids project inside
|
|
505
|
+
* the rect. The box-select compute lives here in Rust, not TS.
|
|
506
|
+
* @param {Float32Array} cam
|
|
507
|
+
* @param {number} aspect
|
|
508
|
+
* @param {number} min_x
|
|
509
|
+
* @param {number} min_y
|
|
510
|
+
* @param {number} max_x
|
|
511
|
+
* @param {number} max_y
|
|
512
|
+
* @returns {string[]}
|
|
513
|
+
*/
|
|
514
|
+
pick_rect(cam, aspect, min_x, min_y, max_x, max_y) {
|
|
515
|
+
const ptr0 = passArrayF32ToWasm0(cam, wasm.__wbindgen_malloc);
|
|
516
|
+
const len0 = WASM_VECTOR_LEN;
|
|
517
|
+
const ret = wasm.engine_pick_rect(this.__wbg_ptr, ptr0, len0, aspect, min_x, min_y, max_x, max_y);
|
|
518
|
+
var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
519
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
520
|
+
return v2;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Flattened `x, y, z` vertex positions of the cached mesh (empty if none).
|
|
524
|
+
* Returned to JS as a `Float32Array`.
|
|
525
|
+
* @returns {Float32Array}
|
|
526
|
+
*/
|
|
527
|
+
positions() {
|
|
528
|
+
const ret = wasm.engine_positions(this.__wbg_ptr);
|
|
529
|
+
var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
|
|
530
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
531
|
+
return v1;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* The most recently evaluated post-process settings as a flat float
|
|
535
|
+
* array for [`Viewport::set_post`](crate::Viewport::set_post):
|
|
536
|
+
* `[bloom_threshold, bloom_knee, bloom_strength, vignette_intensity,
|
|
537
|
+
* vignette_radius, vignette_smoothness, vignette_roundness,
|
|
538
|
+
* film_grain_intensity, film_grain_size, film_grain_time,
|
|
539
|
+
* color_grade_exposure, color_grade_contrast, color_grade_saturation,
|
|
540
|
+
* color_grade_hue]`.
|
|
541
|
+
* @returns {Float32Array}
|
|
542
|
+
*/
|
|
543
|
+
post() {
|
|
544
|
+
const ret = wasm.engine_post(this.__wbg_ptr);
|
|
545
|
+
var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
|
|
546
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
547
|
+
return v1;
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Provide (or replace) an asset's bytes under its handle. The host calls this
|
|
551
|
+
* for each External asset it has fetched (keyed by the handle the scene's
|
|
552
|
+
* nodes reference); the next `tick`/`evaluate` resolves it. Copy-on-write:
|
|
553
|
+
* cheap when the store isn't currently borrowed by an in-flight eval.
|
|
554
|
+
* @param {string} handle
|
|
555
|
+
* @param {string} mime
|
|
556
|
+
* @param {Uint8Array} bytes
|
|
557
|
+
*/
|
|
558
|
+
provide_asset(handle, mime, bytes) {
|
|
559
|
+
const ptr0 = passStringToWasm0(handle, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
560
|
+
const len0 = WASM_VECTOR_LEN;
|
|
561
|
+
const ptr1 = passStringToWasm0(mime, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
562
|
+
const len1 = WASM_VECTOR_LEN;
|
|
563
|
+
const ptr2 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
564
|
+
const len2 = WASM_VECTOR_LEN;
|
|
565
|
+
wasm.engine_provide_asset(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Clear transient and held input state, useful when the host loses focus.
|
|
569
|
+
*/
|
|
570
|
+
reset_input_state() {
|
|
571
|
+
wasm.engine_reset_input_state(this.__wbg_ptr);
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Reset the cached scene runtime to the current document defaults.
|
|
575
|
+
*
|
|
576
|
+
* This keeps the loaded document and cached geometry, but re-seeds declared
|
|
577
|
+
* variables, clears keyboard/pointer/drag state, resets the first-frame start
|
|
578
|
+
* pulse, and restores the evaluated look cache to the current spec defaults.
|
|
579
|
+
* @returns {string}
|
|
580
|
+
*/
|
|
581
|
+
reset_scene() {
|
|
582
|
+
let deferred1_0;
|
|
583
|
+
let deferred1_1;
|
|
584
|
+
try {
|
|
585
|
+
const ret = wasm.engine_reset_scene(this.__wbg_ptr);
|
|
586
|
+
deferred1_0 = ret[0];
|
|
587
|
+
deferred1_1 = ret[1];
|
|
588
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
589
|
+
} finally {
|
|
590
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Cache a [`GraphDocument`] (as JSON) for per-frame evaluation via [`tick`].
|
|
595
|
+
*
|
|
596
|
+
* Returns a JSON status: `{"ok":true}` or `{"ok":false,"error":...}`. Parsing
|
|
597
|
+
* happens once here, not every frame.
|
|
598
|
+
*
|
|
599
|
+
* [`tick`]: Engine::tick
|
|
600
|
+
* @param {string} document_json
|
|
601
|
+
* @returns {string}
|
|
602
|
+
*/
|
|
603
|
+
set_document(document_json) {
|
|
604
|
+
let deferred2_0;
|
|
605
|
+
let deferred2_1;
|
|
606
|
+
try {
|
|
607
|
+
const ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
608
|
+
const len0 = WASM_VECTOR_LEN;
|
|
609
|
+
const ret = wasm.engine_set_document(this.__wbg_ptr, ptr0, len0);
|
|
610
|
+
deferred2_0 = ret[0];
|
|
611
|
+
deferred2_1 = ret[1];
|
|
612
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
613
|
+
} finally {
|
|
614
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Cache a [`GraphDocument`] from its binary (MessagePack) wire form — the
|
|
619
|
+
* payload an exported `scene.wasm` carries. The authoring path stays JSON
|
|
620
|
+
* ([`Engine::set_document`]); this is the runtime path for a binary scene
|
|
621
|
+
* with no embedded assets (or after assets were provided separately).
|
|
622
|
+
* @param {Uint8Array} document_bin
|
|
623
|
+
* @returns {string}
|
|
624
|
+
*/
|
|
625
|
+
set_document_bin(document_bin) {
|
|
626
|
+
let deferred2_0;
|
|
627
|
+
let deferred2_1;
|
|
628
|
+
try {
|
|
629
|
+
const ptr0 = passArray8ToWasm0(document_bin, wasm.__wbindgen_malloc);
|
|
630
|
+
const len0 = WASM_VECTOR_LEN;
|
|
631
|
+
const ret = wasm.engine_set_document_bin(this.__wbg_ptr, ptr0, len0);
|
|
632
|
+
deferred2_0 = ret[0];
|
|
633
|
+
deferred2_1 = ret[1];
|
|
634
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
635
|
+
} finally {
|
|
636
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Set a host-injected external signal bool by name. Read by
|
|
641
|
+
* `input_external_bool` nodes next tick.
|
|
642
|
+
* @param {string} name
|
|
643
|
+
* @param {boolean} value
|
|
644
|
+
*/
|
|
645
|
+
set_external_signal_bool(name, value) {
|
|
646
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
647
|
+
const len0 = WASM_VECTOR_LEN;
|
|
648
|
+
wasm.engine_set_external_signal_bool(this.__wbg_ptr, ptr0, len0, value);
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* Set a host-injected external signal float by name. Read by
|
|
652
|
+
* `input_external_float` nodes next tick; absent keys fall back to the
|
|
653
|
+
* node's literal default. Use `clear_external_signal` to drop a key.
|
|
654
|
+
* @param {string} name
|
|
655
|
+
* @param {number} value
|
|
656
|
+
*/
|
|
657
|
+
set_external_signal_float(name, value) {
|
|
658
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
659
|
+
const len0 = WASM_VECTOR_LEN;
|
|
660
|
+
wasm.engine_set_external_signal_float(this.__wbg_ptr, ptr0, len0, value);
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Set a host-injected external signal vec3 by name. Read by
|
|
664
|
+
* `input_external_vec3` nodes next tick.
|
|
665
|
+
* @param {string} name
|
|
666
|
+
* @param {number} x
|
|
667
|
+
* @param {number} y
|
|
668
|
+
* @param {number} z
|
|
669
|
+
*/
|
|
670
|
+
set_external_signal_vec3(name, x, y, z) {
|
|
671
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
672
|
+
const len0 = WASM_VECTOR_LEN;
|
|
673
|
+
wasm.engine_set_external_signal_vec3(this.__wbg_ptr, ptr0, len0, x, y, z);
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* Update keyboard state from a host `keydown`/`keyup` listener.
|
|
677
|
+
*
|
|
678
|
+
* `key` may be either `KeyboardEvent.key` (`"Space"`, `"a"`, `"ArrowLeft"`)
|
|
679
|
+
* or `KeyboardEvent.code` (`"KeyA"`, `"Digit1"`). The next `tick` exposes
|
|
680
|
+
* key-down/key-up pulses; held state remains true until released.
|
|
681
|
+
* @param {string} key
|
|
682
|
+
* @param {boolean} pressed
|
|
683
|
+
* @returns {string}
|
|
684
|
+
*/
|
|
685
|
+
set_key_state(key, pressed) {
|
|
686
|
+
let deferred2_0;
|
|
687
|
+
let deferred2_1;
|
|
688
|
+
try {
|
|
689
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
690
|
+
const len0 = WASM_VECTOR_LEN;
|
|
691
|
+
const ret = wasm.engine_set_key_state(this.__wbg_ptr, ptr0, len0, pressed);
|
|
692
|
+
deferred2_0 = ret[0];
|
|
693
|
+
deferred2_1 = ret[1];
|
|
694
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
695
|
+
} finally {
|
|
696
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Set the declarative, signal-driven render Look (as a JSON [`LookSpec`]).
|
|
701
|
+
*
|
|
702
|
+
* Every numeric field of the spec is a `ParamValue` — a constant or a driver
|
|
703
|
+
* expression evaluated each `tick` against the live browser signals (exactly
|
|
704
|
+
* like node params). Parsing happens once here, not per frame. Returns the same
|
|
705
|
+
* JSON status shape as [`evaluate`](Engine::evaluate); on parse failure the
|
|
706
|
+
* previous Look spec is kept.
|
|
707
|
+
* @param {string} spec_json
|
|
708
|
+
* @returns {string}
|
|
709
|
+
*/
|
|
710
|
+
set_look_spec(spec_json) {
|
|
711
|
+
let deferred2_0;
|
|
712
|
+
let deferred2_1;
|
|
713
|
+
try {
|
|
714
|
+
const ptr0 = passStringToWasm0(spec_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
715
|
+
const len0 = WASM_VECTOR_LEN;
|
|
716
|
+
const ret = wasm.engine_set_look_spec(this.__wbg_ptr, ptr0, len0);
|
|
717
|
+
deferred2_0 = ret[0];
|
|
718
|
+
deferred2_1 = ret[1];
|
|
719
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
720
|
+
} finally {
|
|
721
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* Set a boolean state variable.
|
|
726
|
+
* @param {string} name
|
|
727
|
+
* @param {boolean} value
|
|
728
|
+
*/
|
|
729
|
+
set_var_bool(name, value) {
|
|
730
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
731
|
+
const len0 = WASM_VECTOR_LEN;
|
|
732
|
+
wasm.engine_set_var_bool(this.__wbg_ptr, ptr0, len0, value);
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* Set an RGBA color state variable (coerced to its declared type). The host→3D
|
|
736
|
+
* color-binding path — e.g. push the current product variant's accent color.
|
|
737
|
+
* @param {string} name
|
|
738
|
+
* @param {number} r
|
|
739
|
+
* @param {number} g
|
|
740
|
+
* @param {number} b
|
|
741
|
+
* @param {number} a
|
|
742
|
+
*/
|
|
743
|
+
set_var_color(name, r, g, b, a) {
|
|
744
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
745
|
+
const len0 = WASM_VECTOR_LEN;
|
|
746
|
+
wasm.engine_set_var_color(this.__wbg_ptr, ptr0, len0, r, g, b, a);
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* Set a numeric state variable (coerced to its declared type). No-op if the
|
|
750
|
+
* value can't coerce to the declared type.
|
|
751
|
+
* @param {string} name
|
|
752
|
+
* @param {number} value
|
|
753
|
+
*/
|
|
754
|
+
set_var_number(name, value) {
|
|
755
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
756
|
+
const len0 = WASM_VECTOR_LEN;
|
|
757
|
+
wasm.engine_set_var_number(this.__wbg_ptr, ptr0, len0, value);
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* Set a 3-component vector state variable (coerced to its declared type).
|
|
761
|
+
* @param {string} name
|
|
762
|
+
* @param {number} x
|
|
763
|
+
* @param {number} y
|
|
764
|
+
* @param {number} z
|
|
765
|
+
*/
|
|
766
|
+
set_var_vector(name, x, y, z) {
|
|
767
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
768
|
+
const len0 = WASM_VECTOR_LEN;
|
|
769
|
+
wasm.engine_set_var_vector(this.__wbg_ptr, ptr0, len0, x, y, z);
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* The ordered provenance table as a JSON array of node-instance-id strings, e.g.
|
|
773
|
+
* `["cube_abc","sphere_def"]`. Index `i` returned by [`Engine::face_source_nodes`]
|
|
774
|
+
* refers to entry `i` here. This is a return value (not a struct field), so
|
|
775
|
+
* serializing a `Vec<String>` with `serde_json` is permitted.
|
|
776
|
+
* @returns {string}
|
|
777
|
+
*/
|
|
778
|
+
source_node_ids() {
|
|
779
|
+
let deferred1_0;
|
|
780
|
+
let deferred1_1;
|
|
781
|
+
try {
|
|
782
|
+
const ret = wasm.engine_source_node_ids(this.__wbg_ptr);
|
|
783
|
+
deferred1_0 = ret[0];
|
|
784
|
+
deferred1_1 = ret[1];
|
|
785
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
786
|
+
} finally {
|
|
787
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* Active scene-wide image bindings, as JSON `[{ "slot": ..., "url": ... }]`.
|
|
792
|
+
*
|
|
793
|
+
* Scans the currently loaded document for `image_texture` nodes (not hidden,
|
|
794
|
+
* with a non-empty `asset_url` literal). The frontend reads this each frame
|
|
795
|
+
* and lazy-loads each URL into RGBA, binding into `Viewport::set_*_map`
|
|
796
|
+
* slots. A later collision (two `image_texture` nodes targeting the same
|
|
797
|
+
* slot) is resolved last-wins, mirroring how the renderer accepts one
|
|
798
|
+
* texture per slot today.
|
|
799
|
+
* @returns {string}
|
|
800
|
+
*/
|
|
801
|
+
texture_bindings_json() {
|
|
802
|
+
let deferred1_0;
|
|
803
|
+
let deferred1_1;
|
|
804
|
+
try {
|
|
805
|
+
const ret = wasm.engine_texture_bindings_json(this.__wbg_ptr);
|
|
806
|
+
deferred1_0 = ret[0];
|
|
807
|
+
deferred1_1 = ret[1];
|
|
808
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
809
|
+
} finally {
|
|
810
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* Evaluate the cached document with the current frame's browser signals.
|
|
815
|
+
*
|
|
816
|
+
* `time` is seconds since the scene started; the frame delta is derived from
|
|
817
|
+
* the previous `tick`. `mouse_x`/`mouse_y` are pixel coordinates (origin
|
|
818
|
+
* top-left). `scroll` is `0..1`. The result is cached for the buffer accessors.
|
|
819
|
+
* Returns the same JSON status shape as [`evaluate`](Engine::evaluate).
|
|
820
|
+
* @param {number} time
|
|
821
|
+
* @param {number} mouse_x
|
|
822
|
+
* @param {number} mouse_y
|
|
823
|
+
* @param {number} scroll
|
|
824
|
+
* @param {number} viewport_w
|
|
825
|
+
* @param {number} viewport_h
|
|
826
|
+
* @param {boolean} click
|
|
827
|
+
* @param {number} section_index
|
|
828
|
+
* @param {number} section_progress
|
|
829
|
+
* @param {boolean} dark_mode
|
|
830
|
+
* @param {boolean} reduced_motion
|
|
831
|
+
* @returns {string}
|
|
832
|
+
*/
|
|
833
|
+
tick(time, mouse_x, mouse_y, scroll, viewport_w, viewport_h, click, section_index, section_progress, dark_mode, reduced_motion) {
|
|
834
|
+
let deferred1_0;
|
|
835
|
+
let deferred1_1;
|
|
836
|
+
try {
|
|
837
|
+
const ret = wasm.engine_tick(this.__wbg_ptr, time, mouse_x, mouse_y, scroll, viewport_w, viewport_h, click, section_index, section_progress, dark_mode, reduced_motion);
|
|
838
|
+
deferred1_0 = ret[0];
|
|
839
|
+
deferred1_1 = ret[1];
|
|
840
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
841
|
+
} finally {
|
|
842
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
if (Symbol.dispose) Engine.prototype[Symbol.dispose] = Engine.prototype.free;
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* A canvas-bound fila renderer.
|
|
850
|
+
*/
|
|
851
|
+
export class Viewport {
|
|
852
|
+
static __wrap(ptr) {
|
|
853
|
+
const obj = Object.create(Viewport.prototype);
|
|
854
|
+
obj.__wbg_ptr = ptr;
|
|
855
|
+
ViewportFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
856
|
+
return obj;
|
|
857
|
+
}
|
|
858
|
+
__destroy_into_raw() {
|
|
859
|
+
const ptr = this.__wbg_ptr;
|
|
860
|
+
this.__wbg_ptr = 0;
|
|
861
|
+
ViewportFinalization.unregister(this);
|
|
862
|
+
return ptr;
|
|
863
|
+
}
|
|
864
|
+
free() {
|
|
865
|
+
const ptr = this.__destroy_into_raw();
|
|
866
|
+
wasm.__wbg_viewport_free(ptr, 0);
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Create a viewport for `canvas`, asynchronously acquiring a wgpu adapter and device and
|
|
870
|
+
* configuring the surface. Rejects (throws a `JsError`) if no adapter/device is available or the
|
|
871
|
+
* surface can't be created.
|
|
872
|
+
* @param {HTMLCanvasElement} canvas
|
|
873
|
+
* @returns {Promise<Viewport>}
|
|
874
|
+
*/
|
|
875
|
+
static create(canvas) {
|
|
876
|
+
const ret = wasm.viewport_create(canvas);
|
|
877
|
+
return ret;
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* Per-frame render instrumentation for the LAST `render_fila`, as a flat float vector:
|
|
881
|
+
* `[scene_lowering_ms, fila_passes_ms, present_ms, buffers_created, bytes_uploaded,
|
|
882
|
+
* bind_groups_created, render_passes, programs_total, pipelines_total, textures_created,
|
|
883
|
+
* submits, t_create_buffer_ms, t_create_bind_group_ms, t_texture_ms, t_end_pass_ms]`. CPU
|
|
884
|
+
* wall-clock for the timing fields (browser `performance.now()`); driver counters for the rest.
|
|
885
|
+
* The editor reads this into `globalThis.__perf` to attribute the frame cost (mesh rebuild vs GPU
|
|
886
|
+
* encode vs present, and per-frame buffer/bind-group/texture churn) and pin what to make persistent.
|
|
887
|
+
* @returns {Float64Array}
|
|
888
|
+
*/
|
|
889
|
+
prof() {
|
|
890
|
+
const ret = wasm.viewport_prof(this.__wbg_ptr);
|
|
891
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
892
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
893
|
+
return v1;
|
|
894
|
+
}
|
|
895
|
+
/**
|
|
896
|
+
* Render the engine's last-evaluated scene through fila and present it to the canvas. The graph is
|
|
897
|
+
* lowered to fila's scene IR by [`crate::Engine::fila_scene`]; the viewport's interactive camera
|
|
898
|
+
* overrides the graph camera so orbit/zoom work. With no geometry yet, the frame is cleared.
|
|
899
|
+
* @param {Engine} engine
|
|
900
|
+
*/
|
|
901
|
+
render_fila(engine) {
|
|
902
|
+
_assertClass(engine, Engine);
|
|
903
|
+
const ret = wasm.viewport_render_fila(this.__wbg_ptr, engine.__wbg_ptr);
|
|
904
|
+
if (ret[1]) {
|
|
905
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
/**
|
|
909
|
+
* GPU-polygonized SDF (metaballs) is parked: fila has no GPU marching-cubes path yet, so an SDF
|
|
910
|
+
* scene clears to the backdrop instead of rendering (tracked: a compute-MC bridge into fila). The
|
|
911
|
+
* arguments mirror the old nf-render signature so the JS hand-off is unchanged.
|
|
912
|
+
* @param {string} _body
|
|
913
|
+
* @param {string} _result
|
|
914
|
+
* @param {Float32Array} _descriptor
|
|
915
|
+
* @param {Float32Array} _signals
|
|
916
|
+
*/
|
|
917
|
+
render_gpu_sdf(_body, _result, _descriptor, _signals) {
|
|
918
|
+
const ptr0 = passStringToWasm0(_body, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
919
|
+
const len0 = WASM_VECTOR_LEN;
|
|
920
|
+
const ptr1 = passStringToWasm0(_result, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
921
|
+
const len1 = WASM_VECTOR_LEN;
|
|
922
|
+
const ptr2 = passArrayF32ToWasm0(_descriptor, wasm.__wbindgen_malloc);
|
|
923
|
+
const len2 = WASM_VECTOR_LEN;
|
|
924
|
+
const ptr3 = passArrayF32ToWasm0(_signals, wasm.__wbindgen_malloc);
|
|
925
|
+
const len3 = WASM_VECTOR_LEN;
|
|
926
|
+
const ret = wasm.viewport_render_gpu_sdf(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
927
|
+
if (ret[1]) {
|
|
928
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* Resize the surface to `w` x `h` pixels and update the camera aspect.
|
|
933
|
+
* @param {number} w
|
|
934
|
+
* @param {number} h
|
|
935
|
+
*/
|
|
936
|
+
resize(w, h) {
|
|
937
|
+
wasm.viewport_resize(this.__wbg_ptr, w, h);
|
|
938
|
+
}
|
|
939
|
+
/**
|
|
940
|
+
* Set the camera from eye/target positions and a vertical field of view (deg).
|
|
941
|
+
* @param {number} eye_x
|
|
942
|
+
* @param {number} eye_y
|
|
943
|
+
* @param {number} eye_z
|
|
944
|
+
* @param {number} target_x
|
|
945
|
+
* @param {number} target_y
|
|
946
|
+
* @param {number} target_z
|
|
947
|
+
* @param {number} fov_deg
|
|
948
|
+
*/
|
|
949
|
+
set_camera(eye_x, eye_y, eye_z, target_x, target_y, target_z, fov_deg) {
|
|
950
|
+
wasm.viewport_set_camera(this.__wbg_ptr, eye_x, eye_y, eye_z, target_x, target_y, target_z, fov_deg);
|
|
951
|
+
}
|
|
952
|
+
/**
|
|
953
|
+
* Switch the camera projection. `mode` accepts `perspective`, `orthographic`, `ortho`, or
|
|
954
|
+
* `orthographic2d`; `orthographic_height` is the vertical world-space size for orthographic mode.
|
|
955
|
+
* @param {string} mode
|
|
956
|
+
* @param {number} orthographic_height
|
|
957
|
+
*/
|
|
958
|
+
set_camera_projection(mode, orthographic_height) {
|
|
959
|
+
const ptr0 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
960
|
+
const len0 = WASM_VECTOR_LEN;
|
|
961
|
+
const ret = wasm.viewport_set_camera_projection(this.__wbg_ptr, ptr0, len0, orthographic_height);
|
|
962
|
+
if (ret[1]) {
|
|
963
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
/**
|
|
967
|
+
* Enable/configure the EDITOR ground grid (a depth-composited pass on the world z=0 plane —
|
|
968
|
+
* geometry occludes the grid). `cell` is the minor cell size (world units); `fade_distance` is
|
|
969
|
+
* where the grid fades to nothing (also the quad's half-extent). EDITOR-ONLY.
|
|
970
|
+
* @param {boolean} enabled
|
|
971
|
+
* @param {number} cell
|
|
972
|
+
* @param {number} fade_distance
|
|
973
|
+
*/
|
|
974
|
+
set_grid(enabled, cell, fade_distance) {
|
|
975
|
+
wasm.viewport_set_grid(this.__wbg_ptr, enabled, cell, fade_distance);
|
|
976
|
+
}
|
|
977
|
+
/**
|
|
978
|
+
* Set the camera from the flat float layout that [`crate::Engine::camera`] emits:
|
|
979
|
+
* `[eye.xyz(3), target.xyz(3), up.xyz(3), fov_y_deg, projection(0 persp/1 ortho),
|
|
980
|
+
* ortho_height, znear, zfar]` (14 floats, + optional pinned aspect at 14). A short slice is
|
|
981
|
+
* ignored. This is the graph-driven camera path; the editor overrides it interactively.
|
|
982
|
+
* @param {Float32Array} c
|
|
983
|
+
*/
|
|
984
|
+
set_scene_camera(c) {
|
|
985
|
+
const ptr0 = passArrayF32ToWasm0(c, wasm.__wbindgen_malloc);
|
|
986
|
+
const len0 = WASM_VECTOR_LEN;
|
|
987
|
+
wasm.viewport_set_scene_camera(this.__wbg_ptr, ptr0, len0);
|
|
988
|
+
}
|
|
989
|
+
/**
|
|
990
|
+
* Upload the selected geometry's triangles for the EDITOR selection outline — tightly-packed
|
|
991
|
+
* world-space xyz positions + triangle indices into them. Empty input clears the selection. The
|
|
992
|
+
* data is held CPU-side; fila-render's selection pass uploads + draws it. EDITOR-ONLY.
|
|
993
|
+
* @param {Float32Array} positions
|
|
994
|
+
* @param {Uint32Array} indices
|
|
995
|
+
*/
|
|
996
|
+
set_selection_mesh(positions, indices) {
|
|
997
|
+
const ptr0 = passArrayF32ToWasm0(positions, wasm.__wbindgen_malloc);
|
|
998
|
+
const len0 = WASM_VECTOR_LEN;
|
|
999
|
+
const ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
|
|
1000
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1001
|
+
wasm.viewport_set_selection_mesh(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1002
|
+
}
|
|
1003
|
+
/**
|
|
1004
|
+
* Enable/configure the EDITOR selection outline (linear RGBA halo color + pixel thickness). Only
|
|
1005
|
+
* draws when enabled AND a selection mesh has been uploaded. EDITOR-ONLY.
|
|
1006
|
+
* @param {boolean} enabled
|
|
1007
|
+
* @param {number} r
|
|
1008
|
+
* @param {number} g
|
|
1009
|
+
* @param {number} b
|
|
1010
|
+
* @param {number} a
|
|
1011
|
+
* @param {number} thickness
|
|
1012
|
+
*/
|
|
1013
|
+
set_selection_outline(enabled, r, g, b, a, thickness) {
|
|
1014
|
+
wasm.viewport_set_selection_outline(this.__wbg_ptr, enabled, r, g, b, a, thickness);
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
if (Symbol.dispose) Viewport.prototype[Symbol.dispose] = Viewport.prototype.free;
|
|
1018
|
+
|
|
1019
|
+
/**
|
|
1020
|
+
* Apply a high-level [`GraphCommand`] to a document.
|
|
1021
|
+
*
|
|
1022
|
+
* `document_json` is a serialized `GraphDocument`; `command_json` is a
|
|
1023
|
+
* serialized `GraphCommand`. Returns a JSON-stringified `CommandResult` —
|
|
1024
|
+
* either `{ ok: true, doc, outcome }` or `{ ok: false, error }`.
|
|
1025
|
+
*
|
|
1026
|
+
* This is a standalone function (NOT a method on [`crate::Engine`]) so the
|
|
1027
|
+
* editor's React state doesn't have to round-trip through any engine handle
|
|
1028
|
+
* just to perform a mutation. The renderer's `Engine::evaluate` is unchanged.
|
|
1029
|
+
* @param {string} document_json
|
|
1030
|
+
* @param {string} command_json
|
|
1031
|
+
* @returns {string}
|
|
1032
|
+
*/
|
|
1033
|
+
export function apply_command(document_json, command_json) {
|
|
1034
|
+
let deferred3_0;
|
|
1035
|
+
let deferred3_1;
|
|
1036
|
+
try {
|
|
1037
|
+
const ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1038
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1039
|
+
const ptr1 = passStringToWasm0(command_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1040
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1041
|
+
const ret = wasm.apply_command(ptr0, len0, ptr1, len1);
|
|
1042
|
+
deferred3_0 = ret[0];
|
|
1043
|
+
deferred3_1 = ret[1];
|
|
1044
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1045
|
+
} finally {
|
|
1046
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
/**
|
|
1051
|
+
* Compute the structural diff between `prev_json` and `next_json`.
|
|
1052
|
+
* Returns a JSON-stringified `DiffResult` — either `{ ok: true, diff }` or
|
|
1053
|
+
* `{ ok: false, error }`.
|
|
1054
|
+
* @param {string} prev_json
|
|
1055
|
+
* @param {string} next_json
|
|
1056
|
+
* @returns {string}
|
|
1057
|
+
*/
|
|
1058
|
+
export function diff_graph(prev_json, next_json) {
|
|
1059
|
+
let deferred3_0;
|
|
1060
|
+
let deferred3_1;
|
|
1061
|
+
try {
|
|
1062
|
+
const ptr0 = passStringToWasm0(prev_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1063
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1064
|
+
const ptr1 = passStringToWasm0(next_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1065
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1066
|
+
const ret = wasm.diff_graph(ptr0, len0, ptr1, len1);
|
|
1067
|
+
deferred3_0 = ret[0];
|
|
1068
|
+
deferred3_1 = ret[1];
|
|
1069
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1070
|
+
} finally {
|
|
1071
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
/**
|
|
1076
|
+
* Compute the downstream closure of `root` in `doc_json`. Mirror of
|
|
1077
|
+
* [`upstream_closure`] but walks consumers; used by the workspace "Isolate"
|
|
1078
|
+
* gesture to compute the visible-while-isolated set.
|
|
1079
|
+
* @param {string} doc_json
|
|
1080
|
+
* @param {string} root
|
|
1081
|
+
* @returns {string}
|
|
1082
|
+
*/
|
|
1083
|
+
export function downstream_closure(doc_json, root) {
|
|
1084
|
+
let deferred3_0;
|
|
1085
|
+
let deferred3_1;
|
|
1086
|
+
try {
|
|
1087
|
+
const ptr0 = passStringToWasm0(doc_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1088
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1089
|
+
const ptr1 = passStringToWasm0(root, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1090
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1091
|
+
const ret = wasm.downstream_closure(ptr0, len0, ptr1, len1);
|
|
1092
|
+
deferred3_0 = ret[0];
|
|
1093
|
+
deferred3_1 = ret[1];
|
|
1094
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1095
|
+
} finally {
|
|
1096
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* Serialize the evaluated mesh to a self-contained glTF 2.0 GLB with its PBR
|
|
1102
|
+
* material and per-vertex colors.
|
|
1103
|
+
*
|
|
1104
|
+
* * `positions`/`normals` are packed xyz, vertex-aligned. Empty `normals` is fine
|
|
1105
|
+
* (omitted from the output — the recomputed shading normals are baked into the
|
|
1106
|
+
* frame anyway).
|
|
1107
|
+
* * `colors` is packed rgba (linear), vertex-aligned, or empty for none → written
|
|
1108
|
+
* as the `COLOR_0` attribute.
|
|
1109
|
+
* * `indices` are triangle indices.
|
|
1110
|
+
* * `material` is the 32-float ABI from `Engine::material` (decoded by
|
|
1111
|
+
* [`Material::from_engine_slice`]); base color, metalness/roughness, emission,
|
|
1112
|
+
* and the glass/finish KHR extensions are written into the glTF material.
|
|
1113
|
+
* @param {Float32Array} positions
|
|
1114
|
+
* @param {Float32Array} normals
|
|
1115
|
+
* @param {Float32Array} colors
|
|
1116
|
+
* @param {Uint32Array} indices
|
|
1117
|
+
* @param {Float32Array} material
|
|
1118
|
+
* @returns {Uint8Array}
|
|
1119
|
+
*/
|
|
1120
|
+
export function export_glb(positions, normals, colors, indices, material) {
|
|
1121
|
+
const ptr0 = passArrayF32ToWasm0(positions, wasm.__wbindgen_malloc);
|
|
1122
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1123
|
+
const ptr1 = passArrayF32ToWasm0(normals, wasm.__wbindgen_malloc);
|
|
1124
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1125
|
+
const ptr2 = passArrayF32ToWasm0(colors, wasm.__wbindgen_malloc);
|
|
1126
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1127
|
+
const ptr3 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
|
|
1128
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1129
|
+
const ptr4 = passArrayF32ToWasm0(material, wasm.__wbindgen_malloc);
|
|
1130
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1131
|
+
const ret = wasm.export_glb(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
1132
|
+
var v6 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1133
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1134
|
+
return v6;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
/**
|
|
1138
|
+
* Serialize flat geometry to Wavefront OBJ text. `positions`/`normals` are packed
|
|
1139
|
+
* xyz; `indices` are triangle indices. Normals are emitted only when present and
|
|
1140
|
+
* vertex-aligned. OBJ is 1-indexed.
|
|
1141
|
+
* @param {Float32Array} positions
|
|
1142
|
+
* @param {Float32Array} normals
|
|
1143
|
+
* @param {Uint32Array} indices
|
|
1144
|
+
* @returns {string}
|
|
1145
|
+
*/
|
|
1146
|
+
export function export_obj(positions, normals, indices) {
|
|
1147
|
+
let deferred4_0;
|
|
1148
|
+
let deferred4_1;
|
|
1149
|
+
try {
|
|
1150
|
+
const ptr0 = passArrayF32ToWasm0(positions, wasm.__wbindgen_malloc);
|
|
1151
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1152
|
+
const ptr1 = passArrayF32ToWasm0(normals, wasm.__wbindgen_malloc);
|
|
1153
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1154
|
+
const ptr2 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
|
|
1155
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1156
|
+
const ret = wasm.export_obj(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1157
|
+
deferred4_0 = ret[0];
|
|
1158
|
+
deferred4_1 = ret[1];
|
|
1159
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1160
|
+
} finally {
|
|
1161
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* Wrap the selected `node_ids` from `doc_json` into a fresh `NodePackage`.
|
|
1167
|
+
* `category_str` is the snake_case `NodeCategory` (e.g. `"generator"`).
|
|
1168
|
+
* @param {string} doc_json
|
|
1169
|
+
* @param {string} node_ids_json
|
|
1170
|
+
* @param {string} type_id
|
|
1171
|
+
* @param {string} label
|
|
1172
|
+
* @param {string} category_str
|
|
1173
|
+
* @returns {string}
|
|
1174
|
+
*/
|
|
1175
|
+
export function extract_component(doc_json, node_ids_json, type_id, label, category_str) {
|
|
1176
|
+
let deferred6_0;
|
|
1177
|
+
let deferred6_1;
|
|
1178
|
+
try {
|
|
1179
|
+
const ptr0 = passStringToWasm0(doc_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1180
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1181
|
+
const ptr1 = passStringToWasm0(node_ids_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1182
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1183
|
+
const ptr2 = passStringToWasm0(type_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1184
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1185
|
+
const ptr3 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1186
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1187
|
+
const ptr4 = passStringToWasm0(category_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1188
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1189
|
+
const ret = wasm.extract_component(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
1190
|
+
deferred6_0 = ret[0];
|
|
1191
|
+
deferred6_1 = ret[1];
|
|
1192
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1193
|
+
} finally {
|
|
1194
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
/**
|
|
1199
|
+
* Append a fresh promoted input. `promoted_json` is the current
|
|
1200
|
+
* `Vec<PromotedInput>` JSON; `target_json` is a `SocketPath` JSON.
|
|
1201
|
+
* @param {string} promoted_json
|
|
1202
|
+
* @param {string} doc_json
|
|
1203
|
+
* @param {string} target_json
|
|
1204
|
+
* @param {string} public_id
|
|
1205
|
+
* @param {string} label
|
|
1206
|
+
* @returns {string}
|
|
1207
|
+
*/
|
|
1208
|
+
export function promote_input(promoted_json, doc_json, target_json, public_id, label) {
|
|
1209
|
+
let deferred6_0;
|
|
1210
|
+
let deferred6_1;
|
|
1211
|
+
try {
|
|
1212
|
+
const ptr0 = passStringToWasm0(promoted_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1213
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1214
|
+
const ptr1 = passStringToWasm0(doc_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1215
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1216
|
+
const ptr2 = passStringToWasm0(target_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1217
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1218
|
+
const ptr3 = passStringToWasm0(public_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1219
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1220
|
+
const ptr4 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1221
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1222
|
+
const ret = wasm.promote_input(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
1223
|
+
deferred6_0 = ret[0];
|
|
1224
|
+
deferred6_1 = ret[1];
|
|
1225
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1226
|
+
} finally {
|
|
1227
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
/**
|
|
1232
|
+
* Update the label of the promoted input whose `socket.id == public_id`.
|
|
1233
|
+
* @param {string} promoted_json
|
|
1234
|
+
* @param {string} public_id
|
|
1235
|
+
* @param {string} new_label
|
|
1236
|
+
* @returns {string}
|
|
1237
|
+
*/
|
|
1238
|
+
export function relabel_promoted_input(promoted_json, public_id, new_label) {
|
|
1239
|
+
let deferred4_0;
|
|
1240
|
+
let deferred4_1;
|
|
1241
|
+
try {
|
|
1242
|
+
const ptr0 = passStringToWasm0(promoted_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1243
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1244
|
+
const ptr1 = passStringToWasm0(public_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1245
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1246
|
+
const ptr2 = passStringToWasm0(new_label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1247
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1248
|
+
const ret = wasm.relabel_promoted_input(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1249
|
+
deferred4_0 = ret[0];
|
|
1250
|
+
deferred4_1 = ret[1];
|
|
1251
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1252
|
+
} finally {
|
|
1253
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
/**
|
|
1258
|
+
* Wasm entry point: install the renderer panic hook (readable console
|
|
1259
|
+
* backtrace + a `globalThis.__nfRendererPanic` flag the `<nf-scene>` host
|
|
1260
|
+
* reads to degrade gracefully on a fatal panic). Marked `#[wasm_bindgen(start)]`
|
|
1261
|
+
* so it runs automatically when the module is instantiated.
|
|
1262
|
+
*/
|
|
1263
|
+
export function start() {
|
|
1264
|
+
wasm.start();
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
/**
|
|
1268
|
+
* Remove the promoted input with `public_id`. Idempotent.
|
|
1269
|
+
* @param {string} promoted_json
|
|
1270
|
+
* @param {string} public_id
|
|
1271
|
+
* @returns {string}
|
|
1272
|
+
*/
|
|
1273
|
+
export function unpromote_input(promoted_json, public_id) {
|
|
1274
|
+
let deferred3_0;
|
|
1275
|
+
let deferred3_1;
|
|
1276
|
+
try {
|
|
1277
|
+
const ptr0 = passStringToWasm0(promoted_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1278
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1279
|
+
const ptr1 = passStringToWasm0(public_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1280
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1281
|
+
const ret = wasm.unpromote_input(ptr0, len0, ptr1, len1);
|
|
1282
|
+
deferred3_0 = ret[0];
|
|
1283
|
+
deferred3_1 = ret[1];
|
|
1284
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1285
|
+
} finally {
|
|
1286
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* Compute the upstream closure of `root` in `doc_json`. Returns the result
|
|
1292
|
+
* as a JSON array of node ids (sorted) OR a JSON `{ ok: false, error }`
|
|
1293
|
+
* envelope on parse failure. The closure itself can't fail; missing roots
|
|
1294
|
+
* just return a single-element vec containing `root`.
|
|
1295
|
+
* @param {string} doc_json
|
|
1296
|
+
* @param {string} root
|
|
1297
|
+
* @returns {string}
|
|
1298
|
+
*/
|
|
1299
|
+
export function upstream_closure(doc_json, root) {
|
|
1300
|
+
let deferred3_0;
|
|
1301
|
+
let deferred3_1;
|
|
1302
|
+
try {
|
|
1303
|
+
const ptr0 = passStringToWasm0(doc_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1304
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1305
|
+
const ptr1 = passStringToWasm0(root, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1306
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1307
|
+
const ret = wasm.upstream_closure(ptr0, len0, ptr1, len1);
|
|
1308
|
+
deferred3_0 = ret[0];
|
|
1309
|
+
deferred3_1 = ret[1];
|
|
1310
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1311
|
+
} finally {
|
|
1312
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
function __wbg_get_imports() {
|
|
1316
|
+
const import0 = {
|
|
1317
|
+
__proto__: null,
|
|
1318
|
+
__wbg_Error_ef53bc310eb298a0: function(arg0, arg1) {
|
|
1319
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
1320
|
+
return ret;
|
|
1321
|
+
},
|
|
1322
|
+
__wbg_Window_65ef42d29dc8174d: function(arg0) {
|
|
1323
|
+
const ret = arg0.Window;
|
|
1324
|
+
return ret;
|
|
1325
|
+
},
|
|
1326
|
+
__wbg_WorkerGlobalScope_d272430d4a323303: function(arg0) {
|
|
1327
|
+
const ret = arg0.WorkerGlobalScope;
|
|
1328
|
+
return ret;
|
|
1329
|
+
},
|
|
1330
|
+
__wbg___wbindgen_debug_string_0accd80f45e5faa2: function(arg0, arg1) {
|
|
1331
|
+
const ret = debugString(arg1);
|
|
1332
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1333
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1334
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1335
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1336
|
+
},
|
|
1337
|
+
__wbg___wbindgen_is_function_754e9f305ff6029e: function(arg0) {
|
|
1338
|
+
const ret = typeof(arg0) === 'function';
|
|
1339
|
+
return ret;
|
|
1340
|
+
},
|
|
1341
|
+
__wbg___wbindgen_is_null_87c3bfe968c6a5ad: function(arg0) {
|
|
1342
|
+
const ret = arg0 === null;
|
|
1343
|
+
return ret;
|
|
1344
|
+
},
|
|
1345
|
+
__wbg___wbindgen_is_object_56732c2bc353f41d: function(arg0) {
|
|
1346
|
+
const val = arg0;
|
|
1347
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
1348
|
+
return ret;
|
|
1349
|
+
},
|
|
1350
|
+
__wbg___wbindgen_is_undefined_67b456be8673d3d7: function(arg0) {
|
|
1351
|
+
const ret = arg0 === undefined;
|
|
1352
|
+
return ret;
|
|
1353
|
+
},
|
|
1354
|
+
__wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
|
|
1355
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1356
|
+
},
|
|
1357
|
+
__wbg__wbg_cb_unref_61db23ac97f16c31: function(arg0) {
|
|
1358
|
+
arg0._wbg_cb_unref();
|
|
1359
|
+
},
|
|
1360
|
+
__wbg_beginRenderPass_865cbdfaecf89f93: function() { return handleError(function (arg0, arg1) {
|
|
1361
|
+
const ret = arg0.beginRenderPass(arg1);
|
|
1362
|
+
return ret;
|
|
1363
|
+
}, arguments); },
|
|
1364
|
+
__wbg_call_9c758de292015997: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1365
|
+
const ret = arg0.call(arg1, arg2);
|
|
1366
|
+
return ret;
|
|
1367
|
+
}, arguments); },
|
|
1368
|
+
__wbg_configure_c0a3d80e97c0e7b1: function() { return handleError(function (arg0, arg1) {
|
|
1369
|
+
arg0.configure(arg1);
|
|
1370
|
+
}, arguments); },
|
|
1371
|
+
__wbg_copyTextureToTexture_bb85c4b0b746d312: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1372
|
+
arg0.copyTextureToTexture(arg1, arg2, arg3);
|
|
1373
|
+
}, arguments); },
|
|
1374
|
+
__wbg_createBindGroupLayout_59891d473ac8665d: function() { return handleError(function (arg0, arg1) {
|
|
1375
|
+
const ret = arg0.createBindGroupLayout(arg1);
|
|
1376
|
+
return ret;
|
|
1377
|
+
}, arguments); },
|
|
1378
|
+
__wbg_createBindGroup_4cb86ff853df5c69: function(arg0, arg1) {
|
|
1379
|
+
const ret = arg0.createBindGroup(arg1);
|
|
1380
|
+
return ret;
|
|
1381
|
+
},
|
|
1382
|
+
__wbg_createBuffer_3fa0256cba655273: function() { return handleError(function (arg0, arg1) {
|
|
1383
|
+
const ret = arg0.createBuffer(arg1);
|
|
1384
|
+
return ret;
|
|
1385
|
+
}, arguments); },
|
|
1386
|
+
__wbg_createCommandEncoder_98e3b731629054b4: function(arg0, arg1) {
|
|
1387
|
+
const ret = arg0.createCommandEncoder(arg1);
|
|
1388
|
+
return ret;
|
|
1389
|
+
},
|
|
1390
|
+
__wbg_createPipelineLayout_270b4fd0b4230373: function(arg0, arg1) {
|
|
1391
|
+
const ret = arg0.createPipelineLayout(arg1);
|
|
1392
|
+
return ret;
|
|
1393
|
+
},
|
|
1394
|
+
__wbg_createRenderPipeline_4c120add6a62a442: function() { return handleError(function (arg0, arg1) {
|
|
1395
|
+
const ret = arg0.createRenderPipeline(arg1);
|
|
1396
|
+
return ret;
|
|
1397
|
+
}, arguments); },
|
|
1398
|
+
__wbg_createSampler_95bff4f5405a3dd1: function(arg0, arg1) {
|
|
1399
|
+
const ret = arg0.createSampler(arg1);
|
|
1400
|
+
return ret;
|
|
1401
|
+
},
|
|
1402
|
+
__wbg_createShaderModule_f0aa469466c7bdaa: function(arg0, arg1) {
|
|
1403
|
+
const ret = arg0.createShaderModule(arg1);
|
|
1404
|
+
return ret;
|
|
1405
|
+
},
|
|
1406
|
+
__wbg_createTexture_28341edbcc7d129e: function() { return handleError(function (arg0, arg1) {
|
|
1407
|
+
const ret = arg0.createTexture(arg1);
|
|
1408
|
+
return ret;
|
|
1409
|
+
}, arguments); },
|
|
1410
|
+
__wbg_createView_d04a0f9bdd723238: function() { return handleError(function (arg0, arg1) {
|
|
1411
|
+
const ret = arg0.createView(arg1);
|
|
1412
|
+
return ret;
|
|
1413
|
+
}, arguments); },
|
|
1414
|
+
__wbg_description_f6ebcdce701b056b: function(arg0, arg1) {
|
|
1415
|
+
const ret = arg1.description;
|
|
1416
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1417
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1418
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1419
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1420
|
+
},
|
|
1421
|
+
__wbg_document_aceb08cd6489baf5: function(arg0) {
|
|
1422
|
+
const ret = arg0.document;
|
|
1423
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1424
|
+
},
|
|
1425
|
+
__wbg_draw_92eb37d6b3b2aab4: function(arg0, arg1, arg2, arg3, arg4) {
|
|
1426
|
+
arg0.draw(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0);
|
|
1427
|
+
},
|
|
1428
|
+
__wbg_end_d49513b309f4ca43: function(arg0) {
|
|
1429
|
+
arg0.end();
|
|
1430
|
+
},
|
|
1431
|
+
__wbg_error_78ff5b3a29b770e0: function(arg0) {
|
|
1432
|
+
console.error(arg0);
|
|
1433
|
+
},
|
|
1434
|
+
__wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
|
|
1435
|
+
let deferred0_0;
|
|
1436
|
+
let deferred0_1;
|
|
1437
|
+
try {
|
|
1438
|
+
deferred0_0 = arg0;
|
|
1439
|
+
deferred0_1 = arg1;
|
|
1440
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
1441
|
+
} finally {
|
|
1442
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1443
|
+
}
|
|
1444
|
+
},
|
|
1445
|
+
__wbg_finish_6c7bba424ffe1bbc: function(arg0, arg1) {
|
|
1446
|
+
const ret = arg0.finish(arg1);
|
|
1447
|
+
return ret;
|
|
1448
|
+
},
|
|
1449
|
+
__wbg_finish_c40b67ff2af88e0c: function(arg0) {
|
|
1450
|
+
const ret = arg0.finish();
|
|
1451
|
+
return ret;
|
|
1452
|
+
},
|
|
1453
|
+
__wbg_getContext_469d34698d869fc1: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1454
|
+
const ret = arg0.getContext(getStringFromWasm0(arg1, arg2));
|
|
1455
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1456
|
+
}, arguments); },
|
|
1457
|
+
__wbg_getContext_7d3a8f461c828713: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1458
|
+
const ret = arg0.getContext(getStringFromWasm0(arg1, arg2));
|
|
1459
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1460
|
+
}, arguments); },
|
|
1461
|
+
__wbg_getCurrentTexture_274b67f871b2dea5: function() { return handleError(function (arg0) {
|
|
1462
|
+
const ret = arg0.getCurrentTexture();
|
|
1463
|
+
return ret;
|
|
1464
|
+
}, arguments); },
|
|
1465
|
+
__wbg_getPreferredCanvasFormat_6f629398d892f0c9: function(arg0) {
|
|
1466
|
+
const ret = arg0.getPreferredCanvasFormat();
|
|
1467
|
+
return (__wbindgen_enum_GpuTextureFormat.indexOf(ret) + 1 || 96) - 1;
|
|
1468
|
+
},
|
|
1469
|
+
__wbg_get_cb935c1402921898: function(arg0, arg1) {
|
|
1470
|
+
const ret = arg0[arg1 >>> 0];
|
|
1471
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1472
|
+
},
|
|
1473
|
+
__wbg_gpu_cbd27ad0589bc0b3: function(arg0) {
|
|
1474
|
+
const ret = arg0.gpu;
|
|
1475
|
+
return ret;
|
|
1476
|
+
},
|
|
1477
|
+
__wbg_height_ef5b5950872773b5: function(arg0) {
|
|
1478
|
+
const ret = arg0.height;
|
|
1479
|
+
return ret;
|
|
1480
|
+
},
|
|
1481
|
+
__wbg_info_91a8fcd51fd17fff: function(arg0) {
|
|
1482
|
+
const ret = arg0.info;
|
|
1483
|
+
return ret;
|
|
1484
|
+
},
|
|
1485
|
+
__wbg_instanceof_GpuAdapter_1297a3a5ce0db3ff: function(arg0) {
|
|
1486
|
+
let result;
|
|
1487
|
+
try {
|
|
1488
|
+
result = arg0 instanceof GPUAdapter;
|
|
1489
|
+
} catch (_) {
|
|
1490
|
+
result = false;
|
|
1491
|
+
}
|
|
1492
|
+
const ret = result;
|
|
1493
|
+
return ret;
|
|
1494
|
+
},
|
|
1495
|
+
__wbg_instanceof_GpuCanvasContext_13613277d7bf3768: function(arg0) {
|
|
1496
|
+
let result;
|
|
1497
|
+
try {
|
|
1498
|
+
result = arg0 instanceof GPUCanvasContext;
|
|
1499
|
+
} catch (_) {
|
|
1500
|
+
result = false;
|
|
1501
|
+
}
|
|
1502
|
+
const ret = result;
|
|
1503
|
+
return ret;
|
|
1504
|
+
},
|
|
1505
|
+
__wbg_instanceof_GpuOutOfMemoryError_100c4600c3e13387: function(arg0) {
|
|
1506
|
+
let result;
|
|
1507
|
+
try {
|
|
1508
|
+
result = arg0 instanceof GPUOutOfMemoryError;
|
|
1509
|
+
} catch (_) {
|
|
1510
|
+
result = false;
|
|
1511
|
+
}
|
|
1512
|
+
const ret = result;
|
|
1513
|
+
return ret;
|
|
1514
|
+
},
|
|
1515
|
+
__wbg_instanceof_GpuValidationError_94580aa7a41f3bdb: function(arg0) {
|
|
1516
|
+
let result;
|
|
1517
|
+
try {
|
|
1518
|
+
result = arg0 instanceof GPUValidationError;
|
|
1519
|
+
} catch (_) {
|
|
1520
|
+
result = false;
|
|
1521
|
+
}
|
|
1522
|
+
const ret = result;
|
|
1523
|
+
return ret;
|
|
1524
|
+
},
|
|
1525
|
+
__wbg_instanceof_Object_873c13f9f41aec78: function(arg0) {
|
|
1526
|
+
let result;
|
|
1527
|
+
try {
|
|
1528
|
+
result = arg0 instanceof Object;
|
|
1529
|
+
} catch (_) {
|
|
1530
|
+
result = false;
|
|
1531
|
+
}
|
|
1532
|
+
const ret = result;
|
|
1533
|
+
return ret;
|
|
1534
|
+
},
|
|
1535
|
+
__wbg_instanceof_Window_e093be59ee9a8e14: function(arg0) {
|
|
1536
|
+
let result;
|
|
1537
|
+
try {
|
|
1538
|
+
result = arg0 instanceof Window;
|
|
1539
|
+
} catch (_) {
|
|
1540
|
+
result = false;
|
|
1541
|
+
}
|
|
1542
|
+
const ret = result;
|
|
1543
|
+
return ret;
|
|
1544
|
+
},
|
|
1545
|
+
__wbg_label_9a8583e3a20fafc7: function(arg0, arg1) {
|
|
1546
|
+
const ret = arg1.label;
|
|
1547
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1548
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1549
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1550
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1551
|
+
},
|
|
1552
|
+
__wbg_limits_25f7265ea0cad6c5: function(arg0) {
|
|
1553
|
+
const ret = arg0.limits;
|
|
1554
|
+
return ret;
|
|
1555
|
+
},
|
|
1556
|
+
__wbg_mapAsync_e3cfbd141919d03c: function(arg0, arg1, arg2, arg3) {
|
|
1557
|
+
const ret = arg0.mapAsync(arg1 >>> 0, arg2, arg3);
|
|
1558
|
+
return ret;
|
|
1559
|
+
},
|
|
1560
|
+
__wbg_maxBindGroups_7e4965b5daa53b23: function(arg0) {
|
|
1561
|
+
const ret = arg0.maxBindGroups;
|
|
1562
|
+
return ret;
|
|
1563
|
+
},
|
|
1564
|
+
__wbg_maxBindingsPerBindGroup_5d11588150650215: function(arg0) {
|
|
1565
|
+
const ret = arg0.maxBindingsPerBindGroup;
|
|
1566
|
+
return ret;
|
|
1567
|
+
},
|
|
1568
|
+
__wbg_maxBufferSize_b59f147488bf047a: function(arg0) {
|
|
1569
|
+
const ret = arg0.maxBufferSize;
|
|
1570
|
+
return ret;
|
|
1571
|
+
},
|
|
1572
|
+
__wbg_maxColorAttachmentBytesPerSample_726ea37aedfb839a: function(arg0) {
|
|
1573
|
+
const ret = arg0.maxColorAttachmentBytesPerSample;
|
|
1574
|
+
return ret;
|
|
1575
|
+
},
|
|
1576
|
+
__wbg_maxColorAttachments_62ecca7ef94d78e4: function(arg0) {
|
|
1577
|
+
const ret = arg0.maxColorAttachments;
|
|
1578
|
+
return ret;
|
|
1579
|
+
},
|
|
1580
|
+
__wbg_maxComputeInvocationsPerWorkgroup_a14458d75e0b90ac: function(arg0) {
|
|
1581
|
+
const ret = arg0.maxComputeInvocationsPerWorkgroup;
|
|
1582
|
+
return ret;
|
|
1583
|
+
},
|
|
1584
|
+
__wbg_maxComputeWorkgroupSizeX_6b8c17d5e4738e77: function(arg0) {
|
|
1585
|
+
const ret = arg0.maxComputeWorkgroupSizeX;
|
|
1586
|
+
return ret;
|
|
1587
|
+
},
|
|
1588
|
+
__wbg_maxComputeWorkgroupSizeY_13b5de41c6e0bc2a: function(arg0) {
|
|
1589
|
+
const ret = arg0.maxComputeWorkgroupSizeY;
|
|
1590
|
+
return ret;
|
|
1591
|
+
},
|
|
1592
|
+
__wbg_maxComputeWorkgroupSizeZ_b12d7f3e670aa0a2: function(arg0) {
|
|
1593
|
+
const ret = arg0.maxComputeWorkgroupSizeZ;
|
|
1594
|
+
return ret;
|
|
1595
|
+
},
|
|
1596
|
+
__wbg_maxComputeWorkgroupStorageSize_886498bc3b0baa23: function(arg0) {
|
|
1597
|
+
const ret = arg0.maxComputeWorkgroupStorageSize;
|
|
1598
|
+
return ret;
|
|
1599
|
+
},
|
|
1600
|
+
__wbg_maxComputeWorkgroupsPerDimension_144b6bbf6ac24451: function(arg0) {
|
|
1601
|
+
const ret = arg0.maxComputeWorkgroupsPerDimension;
|
|
1602
|
+
return ret;
|
|
1603
|
+
},
|
|
1604
|
+
__wbg_maxDynamicStorageBuffersPerPipelineLayout_d81239ef90f4f920: function(arg0) {
|
|
1605
|
+
const ret = arg0.maxDynamicStorageBuffersPerPipelineLayout;
|
|
1606
|
+
return ret;
|
|
1607
|
+
},
|
|
1608
|
+
__wbg_maxDynamicUniformBuffersPerPipelineLayout_0cca7d1cb9e5adf7: function(arg0) {
|
|
1609
|
+
const ret = arg0.maxDynamicUniformBuffersPerPipelineLayout;
|
|
1610
|
+
return ret;
|
|
1611
|
+
},
|
|
1612
|
+
__wbg_maxInterStageShaderVariables_4504147f810dd43d: function(arg0) {
|
|
1613
|
+
const ret = arg0.maxInterStageShaderVariables;
|
|
1614
|
+
return ret;
|
|
1615
|
+
},
|
|
1616
|
+
__wbg_maxSampledTexturesPerShaderStage_54e5ed0537676c83: function(arg0) {
|
|
1617
|
+
const ret = arg0.maxSampledTexturesPerShaderStage;
|
|
1618
|
+
return ret;
|
|
1619
|
+
},
|
|
1620
|
+
__wbg_maxSamplersPerShaderStage_71315fab0d7f34b1: function(arg0) {
|
|
1621
|
+
const ret = arg0.maxSamplersPerShaderStage;
|
|
1622
|
+
return ret;
|
|
1623
|
+
},
|
|
1624
|
+
__wbg_maxStorageBufferBindingSize_779fd522aaaa6f90: function(arg0) {
|
|
1625
|
+
const ret = arg0.maxStorageBufferBindingSize;
|
|
1626
|
+
return ret;
|
|
1627
|
+
},
|
|
1628
|
+
__wbg_maxStorageBuffersPerShaderStage_c99b4f72aaf19e34: function(arg0) {
|
|
1629
|
+
const ret = arg0.maxStorageBuffersPerShaderStage;
|
|
1630
|
+
return ret;
|
|
1631
|
+
},
|
|
1632
|
+
__wbg_maxStorageTexturesPerShaderStage_5403c17d11da5280: function(arg0) {
|
|
1633
|
+
const ret = arg0.maxStorageTexturesPerShaderStage;
|
|
1634
|
+
return ret;
|
|
1635
|
+
},
|
|
1636
|
+
__wbg_maxTextureArrayLayers_eca9fa36b3d46099: function(arg0) {
|
|
1637
|
+
const ret = arg0.maxTextureArrayLayers;
|
|
1638
|
+
return ret;
|
|
1639
|
+
},
|
|
1640
|
+
__wbg_maxTextureDimension1D_a7d9d7ecd19aae9b: function(arg0) {
|
|
1641
|
+
const ret = arg0.maxTextureDimension1D;
|
|
1642
|
+
return ret;
|
|
1643
|
+
},
|
|
1644
|
+
__wbg_maxTextureDimension2D_c6a3937eb3ab18df: function(arg0) {
|
|
1645
|
+
const ret = arg0.maxTextureDimension2D;
|
|
1646
|
+
return ret;
|
|
1647
|
+
},
|
|
1648
|
+
__wbg_maxTextureDimension3D_d941aa547d9e0801: function(arg0) {
|
|
1649
|
+
const ret = arg0.maxTextureDimension3D;
|
|
1650
|
+
return ret;
|
|
1651
|
+
},
|
|
1652
|
+
__wbg_maxUniformBufferBindingSize_1e8c92a2094b7ce7: function(arg0) {
|
|
1653
|
+
const ret = arg0.maxUniformBufferBindingSize;
|
|
1654
|
+
return ret;
|
|
1655
|
+
},
|
|
1656
|
+
__wbg_maxUniformBuffersPerShaderStage_83cde6650612f178: function(arg0) {
|
|
1657
|
+
const ret = arg0.maxUniformBuffersPerShaderStage;
|
|
1658
|
+
return ret;
|
|
1659
|
+
},
|
|
1660
|
+
__wbg_maxVertexAttributes_dd313a3540d56e88: function(arg0) {
|
|
1661
|
+
const ret = arg0.maxVertexAttributes;
|
|
1662
|
+
return ret;
|
|
1663
|
+
},
|
|
1664
|
+
__wbg_maxVertexBufferArrayStride_6fd082d9954d1f4a: function(arg0) {
|
|
1665
|
+
const ret = arg0.maxVertexBufferArrayStride;
|
|
1666
|
+
return ret;
|
|
1667
|
+
},
|
|
1668
|
+
__wbg_maxVertexBuffers_bbd14712ac158c6f: function(arg0) {
|
|
1669
|
+
const ret = arg0.maxVertexBuffers;
|
|
1670
|
+
return ret;
|
|
1671
|
+
},
|
|
1672
|
+
__wbg_message_1c3aafa647009286: function(arg0, arg1) {
|
|
1673
|
+
const ret = arg1.message;
|
|
1674
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1675
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1676
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1677
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1678
|
+
},
|
|
1679
|
+
__wbg_minStorageBufferOffsetAlignment_726c386298254510: function(arg0) {
|
|
1680
|
+
const ret = arg0.minStorageBufferOffsetAlignment;
|
|
1681
|
+
return ret;
|
|
1682
|
+
},
|
|
1683
|
+
__wbg_minUniformBufferOffsetAlignment_6df1f95f5974788e: function(arg0) {
|
|
1684
|
+
const ret = arg0.minUniformBufferOffsetAlignment;
|
|
1685
|
+
return ret;
|
|
1686
|
+
},
|
|
1687
|
+
__wbg_navigator_3833ecdbc19d2757: function(arg0) {
|
|
1688
|
+
const ret = arg0.navigator;
|
|
1689
|
+
return ret;
|
|
1690
|
+
},
|
|
1691
|
+
__wbg_navigator_391291470f58c650: function(arg0) {
|
|
1692
|
+
const ret = arg0.navigator;
|
|
1693
|
+
return ret;
|
|
1694
|
+
},
|
|
1695
|
+
__wbg_new_227d7c05414eb861: function() {
|
|
1696
|
+
const ret = new Error();
|
|
1697
|
+
return ret;
|
|
1698
|
+
},
|
|
1699
|
+
__wbg_new_ce1ab61c1c2b300d: function() {
|
|
1700
|
+
const ret = new Object();
|
|
1701
|
+
return ret;
|
|
1702
|
+
},
|
|
1703
|
+
__wbg_new_d90091b82fdf5b91: function() {
|
|
1704
|
+
const ret = new Array();
|
|
1705
|
+
return ret;
|
|
1706
|
+
},
|
|
1707
|
+
__wbg_new_typed_bf31d18f92484486: function(arg0, arg1) {
|
|
1708
|
+
try {
|
|
1709
|
+
var state0 = {a: arg0, b: arg1};
|
|
1710
|
+
var cb0 = (arg0, arg1) => {
|
|
1711
|
+
const a = state0.a;
|
|
1712
|
+
state0.a = 0;
|
|
1713
|
+
try {
|
|
1714
|
+
return wasm_bindgen__convert__closures_____invoke__h1ef02cf0d1d48747(a, state0.b, arg0, arg1);
|
|
1715
|
+
} finally {
|
|
1716
|
+
state0.a = a;
|
|
1717
|
+
}
|
|
1718
|
+
};
|
|
1719
|
+
const ret = new Promise(cb0);
|
|
1720
|
+
return ret;
|
|
1721
|
+
} finally {
|
|
1722
|
+
state0.a = 0;
|
|
1723
|
+
}
|
|
1724
|
+
},
|
|
1725
|
+
__wbg_now_f565250295e2d180: function(arg0) {
|
|
1726
|
+
const ret = arg0.now();
|
|
1727
|
+
return ret;
|
|
1728
|
+
},
|
|
1729
|
+
__wbg_onSubmittedWorkDone_5f36409816d68e04: function(arg0) {
|
|
1730
|
+
const ret = arg0.onSubmittedWorkDone();
|
|
1731
|
+
return ret;
|
|
1732
|
+
},
|
|
1733
|
+
__wbg_performance_68499ca0718837f5: function(arg0) {
|
|
1734
|
+
const ret = arg0.performance;
|
|
1735
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1736
|
+
},
|
|
1737
|
+
__wbg_popErrorScope_966d33c301ea1c49: function(arg0) {
|
|
1738
|
+
const ret = arg0.popErrorScope();
|
|
1739
|
+
return ret;
|
|
1740
|
+
},
|
|
1741
|
+
__wbg_pushErrorScope_163b750023f93530: function(arg0, arg1) {
|
|
1742
|
+
arg0.pushErrorScope(__wbindgen_enum_GpuErrorFilter[arg1]);
|
|
1743
|
+
},
|
|
1744
|
+
__wbg_push_a6822215aa43e71c: function(arg0, arg1) {
|
|
1745
|
+
const ret = arg0.push(arg1);
|
|
1746
|
+
return ret;
|
|
1747
|
+
},
|
|
1748
|
+
__wbg_querySelectorAll_4dcc230a2f8a2498: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1749
|
+
const ret = arg0.querySelectorAll(getStringFromWasm0(arg1, arg2));
|
|
1750
|
+
return ret;
|
|
1751
|
+
}, arguments); },
|
|
1752
|
+
__wbg_queueMicrotask_35c611f4a14830b2: function(arg0) {
|
|
1753
|
+
queueMicrotask(arg0);
|
|
1754
|
+
},
|
|
1755
|
+
__wbg_queueMicrotask_404ed0a58e0b63cc: function(arg0) {
|
|
1756
|
+
const ret = arg0.queueMicrotask;
|
|
1757
|
+
return ret;
|
|
1758
|
+
},
|
|
1759
|
+
__wbg_queue_7bbf92178b06da19: function(arg0) {
|
|
1760
|
+
const ret = arg0.queue;
|
|
1761
|
+
return ret;
|
|
1762
|
+
},
|
|
1763
|
+
__wbg_requestAdapter_0049683abd339828: function(arg0, arg1) {
|
|
1764
|
+
const ret = arg0.requestAdapter(arg1);
|
|
1765
|
+
return ret;
|
|
1766
|
+
},
|
|
1767
|
+
__wbg_requestDevice_921f0a221b4492fa: function(arg0, arg1) {
|
|
1768
|
+
const ret = arg0.requestDevice(arg1);
|
|
1769
|
+
return ret;
|
|
1770
|
+
},
|
|
1771
|
+
__wbg_resolve_25a7e548d5881dca: function(arg0) {
|
|
1772
|
+
const ret = Promise.resolve(arg0);
|
|
1773
|
+
return ret;
|
|
1774
|
+
},
|
|
1775
|
+
__wbg_setBindGroup_851043cf286f55f2: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
|
|
1776
|
+
arg0.setBindGroup(arg1 >>> 0, arg2, getArrayU32FromWasm0(arg3, arg4), arg5, arg6 >>> 0);
|
|
1777
|
+
}, arguments); },
|
|
1778
|
+
__wbg_setBindGroup_b546d112a2d27da3: function(arg0, arg1, arg2) {
|
|
1779
|
+
arg0.setBindGroup(arg1 >>> 0, arg2);
|
|
1780
|
+
},
|
|
1781
|
+
__wbg_setPipeline_b0ecc74bdf8be629: function(arg0, arg1) {
|
|
1782
|
+
arg0.setPipeline(arg1);
|
|
1783
|
+
},
|
|
1784
|
+
__wbg_setScissorRect_a1545e0e0ae58d7e: function(arg0, arg1, arg2, arg3, arg4) {
|
|
1785
|
+
arg0.setScissorRect(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0);
|
|
1786
|
+
},
|
|
1787
|
+
__wbg_setVertexBuffer_1d85cc2da6e137a7: function(arg0, arg1, arg2, arg3, arg4) {
|
|
1788
|
+
arg0.setVertexBuffer(arg1 >>> 0, arg2, arg3, arg4);
|
|
1789
|
+
},
|
|
1790
|
+
__wbg_setVertexBuffer_7f434cea2ca9b640: function(arg0, arg1, arg2, arg3) {
|
|
1791
|
+
arg0.setVertexBuffer(arg1 >>> 0, arg2, arg3);
|
|
1792
|
+
},
|
|
1793
|
+
__wbg_set_6e30c9374c26414c: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1794
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
1795
|
+
return ret;
|
|
1796
|
+
}, arguments); },
|
|
1797
|
+
__wbg_set_a_66601ffa2f4cbde8: function(arg0, arg1) {
|
|
1798
|
+
arg0.a = arg1;
|
|
1799
|
+
},
|
|
1800
|
+
__wbg_set_access_08d6bdbda9aaa266: function(arg0, arg1) {
|
|
1801
|
+
arg0.access = __wbindgen_enum_GpuStorageTextureAccess[arg1];
|
|
1802
|
+
},
|
|
1803
|
+
__wbg_set_address_mode_u_f80c73fc36e83289: function(arg0, arg1) {
|
|
1804
|
+
arg0.addressModeU = __wbindgen_enum_GpuAddressMode[arg1];
|
|
1805
|
+
},
|
|
1806
|
+
__wbg_set_address_mode_v_3dee7a0095c326a6: function(arg0, arg1) {
|
|
1807
|
+
arg0.addressModeV = __wbindgen_enum_GpuAddressMode[arg1];
|
|
1808
|
+
},
|
|
1809
|
+
__wbg_set_address_mode_w_e2be52f6efa2d9c7: function(arg0, arg1) {
|
|
1810
|
+
arg0.addressModeW = __wbindgen_enum_GpuAddressMode[arg1];
|
|
1811
|
+
},
|
|
1812
|
+
__wbg_set_alpha_bb6680aaf01cdc62: function(arg0, arg1) {
|
|
1813
|
+
arg0.alpha = arg1;
|
|
1814
|
+
},
|
|
1815
|
+
__wbg_set_alpha_mode_84140629c3b15c51: function(arg0, arg1) {
|
|
1816
|
+
arg0.alphaMode = __wbindgen_enum_GpuCanvasAlphaMode[arg1];
|
|
1817
|
+
},
|
|
1818
|
+
__wbg_set_alpha_to_coverage_enabled_cac9212446be9cab: function(arg0, arg1) {
|
|
1819
|
+
arg0.alphaToCoverageEnabled = arg1 !== 0;
|
|
1820
|
+
},
|
|
1821
|
+
__wbg_set_array_layer_count_01e36293bee85e02: function(arg0, arg1) {
|
|
1822
|
+
arg0.arrayLayerCount = arg1 >>> 0;
|
|
1823
|
+
},
|
|
1824
|
+
__wbg_set_array_stride_34f4a147a16bff79: function(arg0, arg1) {
|
|
1825
|
+
arg0.arrayStride = arg1;
|
|
1826
|
+
},
|
|
1827
|
+
__wbg_set_aspect_0675b2844dd12eb1: function(arg0, arg1) {
|
|
1828
|
+
arg0.aspect = __wbindgen_enum_GpuTextureAspect[arg1];
|
|
1829
|
+
},
|
|
1830
|
+
__wbg_set_aspect_e09cb246c2df6f46: function(arg0, arg1) {
|
|
1831
|
+
arg0.aspect = __wbindgen_enum_GpuTextureAspect[arg1];
|
|
1832
|
+
},
|
|
1833
|
+
__wbg_set_attributes_7ee8e82215809bfa: function(arg0, arg1) {
|
|
1834
|
+
arg0.attributes = arg1;
|
|
1835
|
+
},
|
|
1836
|
+
__wbg_set_b_103abfb3e69345a3: function(arg0, arg1) {
|
|
1837
|
+
arg0.b = arg1;
|
|
1838
|
+
},
|
|
1839
|
+
__wbg_set_base_array_layer_ff3450be9aa7d232: function(arg0, arg1) {
|
|
1840
|
+
arg0.baseArrayLayer = arg1 >>> 0;
|
|
1841
|
+
},
|
|
1842
|
+
__wbg_set_base_mip_level_43e77e5d237ede24: function(arg0, arg1) {
|
|
1843
|
+
arg0.baseMipLevel = arg1 >>> 0;
|
|
1844
|
+
},
|
|
1845
|
+
__wbg_set_beginning_of_pass_write_index_abea1e4e6c6095e1: function(arg0, arg1) {
|
|
1846
|
+
arg0.beginningOfPassWriteIndex = arg1 >>> 0;
|
|
1847
|
+
},
|
|
1848
|
+
__wbg_set_bind_group_layouts_078241cf2822c39e: function(arg0, arg1) {
|
|
1849
|
+
arg0.bindGroupLayouts = arg1;
|
|
1850
|
+
},
|
|
1851
|
+
__wbg_set_binding_d683cd9c1d4bcfed: function(arg0, arg1) {
|
|
1852
|
+
arg0.binding = arg1 >>> 0;
|
|
1853
|
+
},
|
|
1854
|
+
__wbg_set_binding_e9ba14423117de0a: function(arg0, arg1) {
|
|
1855
|
+
arg0.binding = arg1 >>> 0;
|
|
1856
|
+
},
|
|
1857
|
+
__wbg_set_blend_9eab91d6edf500f9: function(arg0, arg1) {
|
|
1858
|
+
arg0.blend = arg1;
|
|
1859
|
+
},
|
|
1860
|
+
__wbg_set_buffer_598ab98a251b8f91: function(arg0, arg1) {
|
|
1861
|
+
arg0.buffer = arg1;
|
|
1862
|
+
},
|
|
1863
|
+
__wbg_set_buffer_73d9f6fea9c41867: function(arg0, arg1) {
|
|
1864
|
+
arg0.buffer = arg1;
|
|
1865
|
+
},
|
|
1866
|
+
__wbg_set_buffers_93f3f75d7338864f: function(arg0, arg1) {
|
|
1867
|
+
arg0.buffers = arg1;
|
|
1868
|
+
},
|
|
1869
|
+
__wbg_set_bytes_per_row_0bdd54b7fc03c765: function(arg0, arg1) {
|
|
1870
|
+
arg0.bytesPerRow = arg1 >>> 0;
|
|
1871
|
+
},
|
|
1872
|
+
__wbg_set_clear_value_c1a82bbe9a80b6ab: function(arg0, arg1) {
|
|
1873
|
+
arg0.clearValue = arg1;
|
|
1874
|
+
},
|
|
1875
|
+
__wbg_set_code_6a0d763da082dcfb: function(arg0, arg1, arg2) {
|
|
1876
|
+
arg0.code = getStringFromWasm0(arg1, arg2);
|
|
1877
|
+
},
|
|
1878
|
+
__wbg_set_color_495aa415ae5a39c9: function(arg0, arg1) {
|
|
1879
|
+
arg0.color = arg1;
|
|
1880
|
+
},
|
|
1881
|
+
__wbg_set_color_attachments_6705c6b1e98a3040: function(arg0, arg1) {
|
|
1882
|
+
arg0.colorAttachments = arg1;
|
|
1883
|
+
},
|
|
1884
|
+
__wbg_set_compare_8aedfdbdc96ff4d7: function(arg0, arg1) {
|
|
1885
|
+
arg0.compare = __wbindgen_enum_GpuCompareFunction[arg1];
|
|
1886
|
+
},
|
|
1887
|
+
__wbg_set_compare_a9a06469832600ec: function(arg0, arg1) {
|
|
1888
|
+
arg0.compare = __wbindgen_enum_GpuCompareFunction[arg1];
|
|
1889
|
+
},
|
|
1890
|
+
__wbg_set_count_34ecf81b3ad7e448: function(arg0, arg1) {
|
|
1891
|
+
arg0.count = arg1 >>> 0;
|
|
1892
|
+
},
|
|
1893
|
+
__wbg_set_cull_mode_8e533f32672a379b: function(arg0, arg1) {
|
|
1894
|
+
arg0.cullMode = __wbindgen_enum_GpuCullMode[arg1];
|
|
1895
|
+
},
|
|
1896
|
+
__wbg_set_depth_bias_07f95aa380a3e46e: function(arg0, arg1) {
|
|
1897
|
+
arg0.depthBias = arg1;
|
|
1898
|
+
},
|
|
1899
|
+
__wbg_set_depth_bias_clamp_968b03f74984c77b: function(arg0, arg1) {
|
|
1900
|
+
arg0.depthBiasClamp = arg1;
|
|
1901
|
+
},
|
|
1902
|
+
__wbg_set_depth_bias_slope_scale_478b204b4910400f: function(arg0, arg1) {
|
|
1903
|
+
arg0.depthBiasSlopeScale = arg1;
|
|
1904
|
+
},
|
|
1905
|
+
__wbg_set_depth_clear_value_25268aa6b7cae2e0: function(arg0, arg1) {
|
|
1906
|
+
arg0.depthClearValue = arg1;
|
|
1907
|
+
},
|
|
1908
|
+
__wbg_set_depth_compare_c017fcac5327dfbb: function(arg0, arg1) {
|
|
1909
|
+
arg0.depthCompare = __wbindgen_enum_GpuCompareFunction[arg1];
|
|
1910
|
+
},
|
|
1911
|
+
__wbg_set_depth_fail_op_8484012cd5e4987c: function(arg0, arg1) {
|
|
1912
|
+
arg0.depthFailOp = __wbindgen_enum_GpuStencilOperation[arg1];
|
|
1913
|
+
},
|
|
1914
|
+
__wbg_set_depth_load_op_ed90e4eaf314a16c: function(arg0, arg1) {
|
|
1915
|
+
arg0.depthLoadOp = __wbindgen_enum_GpuLoadOp[arg1];
|
|
1916
|
+
},
|
|
1917
|
+
__wbg_set_depth_or_array_layers_f8981011496f12e7: function(arg0, arg1) {
|
|
1918
|
+
arg0.depthOrArrayLayers = arg1 >>> 0;
|
|
1919
|
+
},
|
|
1920
|
+
__wbg_set_depth_read_only_90cca09674f446be: function(arg0, arg1) {
|
|
1921
|
+
arg0.depthReadOnly = arg1 !== 0;
|
|
1922
|
+
},
|
|
1923
|
+
__wbg_set_depth_stencil_attachment_be8301fa499cd3db: function(arg0, arg1) {
|
|
1924
|
+
arg0.depthStencilAttachment = arg1;
|
|
1925
|
+
},
|
|
1926
|
+
__wbg_set_depth_stencil_d536398c1b29bb38: function(arg0, arg1) {
|
|
1927
|
+
arg0.depthStencil = arg1;
|
|
1928
|
+
},
|
|
1929
|
+
__wbg_set_depth_store_op_8e9b1d0e47077643: function(arg0, arg1) {
|
|
1930
|
+
arg0.depthStoreOp = __wbindgen_enum_GpuStoreOp[arg1];
|
|
1931
|
+
},
|
|
1932
|
+
__wbg_set_depth_write_enabled_adc2094871d66639: function(arg0, arg1) {
|
|
1933
|
+
arg0.depthWriteEnabled = arg1 !== 0;
|
|
1934
|
+
},
|
|
1935
|
+
__wbg_set_device_47147a331245777f: function(arg0, arg1) {
|
|
1936
|
+
arg0.device = arg1;
|
|
1937
|
+
},
|
|
1938
|
+
__wbg_set_dimension_b4da3979dc699ef8: function(arg0, arg1) {
|
|
1939
|
+
arg0.dimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
|
|
1940
|
+
},
|
|
1941
|
+
__wbg_set_dimension_d4f0c50e75083b7f: function(arg0, arg1) {
|
|
1942
|
+
arg0.dimension = __wbindgen_enum_GpuTextureDimension[arg1];
|
|
1943
|
+
},
|
|
1944
|
+
__wbg_set_dst_factor_e44fc612d5e5bff4: function(arg0, arg1) {
|
|
1945
|
+
arg0.dstFactor = __wbindgen_enum_GpuBlendFactor[arg1];
|
|
1946
|
+
},
|
|
1947
|
+
__wbg_set_end_of_pass_write_index_1cd39b9bafe090cc: function(arg0, arg1) {
|
|
1948
|
+
arg0.endOfPassWriteIndex = arg1 >>> 0;
|
|
1949
|
+
},
|
|
1950
|
+
__wbg_set_entries_070b048e4bea0c29: function(arg0, arg1) {
|
|
1951
|
+
arg0.entries = arg1;
|
|
1952
|
+
},
|
|
1953
|
+
__wbg_set_entries_f9b7f3d4e9faccf4: function(arg0, arg1) {
|
|
1954
|
+
arg0.entries = arg1;
|
|
1955
|
+
},
|
|
1956
|
+
__wbg_set_entry_point_0116a9f5d58cf0aa: function(arg0, arg1, arg2) {
|
|
1957
|
+
arg0.entryPoint = getStringFromWasm0(arg1, arg2);
|
|
1958
|
+
},
|
|
1959
|
+
__wbg_set_entry_point_f04e91eced449196: function(arg0, arg1, arg2) {
|
|
1960
|
+
arg0.entryPoint = getStringFromWasm0(arg1, arg2);
|
|
1961
|
+
},
|
|
1962
|
+
__wbg_set_external_texture_cf122b1392d58f37: function(arg0, arg1) {
|
|
1963
|
+
arg0.externalTexture = arg1;
|
|
1964
|
+
},
|
|
1965
|
+
__wbg_set_fail_op_e7eb17ed0228b457: function(arg0, arg1) {
|
|
1966
|
+
arg0.failOp = __wbindgen_enum_GpuStencilOperation[arg1];
|
|
1967
|
+
},
|
|
1968
|
+
__wbg_set_format_119bda0a3d0b3f47: function(arg0, arg1) {
|
|
1969
|
+
arg0.format = __wbindgen_enum_GpuTextureFormat[arg1];
|
|
1970
|
+
},
|
|
1971
|
+
__wbg_set_format_27c63de9b0ec1cb3: function(arg0, arg1) {
|
|
1972
|
+
arg0.format = __wbindgen_enum_GpuTextureFormat[arg1];
|
|
1973
|
+
},
|
|
1974
|
+
__wbg_set_format_75eb905a003c2f61: function(arg0, arg1) {
|
|
1975
|
+
arg0.format = __wbindgen_enum_GpuTextureFormat[arg1];
|
|
1976
|
+
},
|
|
1977
|
+
__wbg_set_format_8b8359f261ea64b9: function(arg0, arg1) {
|
|
1978
|
+
arg0.format = __wbindgen_enum_GpuVertexFormat[arg1];
|
|
1979
|
+
},
|
|
1980
|
+
__wbg_set_format_a5d373801c562623: function(arg0, arg1) {
|
|
1981
|
+
arg0.format = __wbindgen_enum_GpuTextureFormat[arg1];
|
|
1982
|
+
},
|
|
1983
|
+
__wbg_set_format_b08d87d5f33bcd89: function(arg0, arg1) {
|
|
1984
|
+
arg0.format = __wbindgen_enum_GpuTextureFormat[arg1];
|
|
1985
|
+
},
|
|
1986
|
+
__wbg_set_format_c1a342a37ced3e12: function(arg0, arg1) {
|
|
1987
|
+
arg0.format = __wbindgen_enum_GpuTextureFormat[arg1];
|
|
1988
|
+
},
|
|
1989
|
+
__wbg_set_fragment_41044c9110c69c90: function(arg0, arg1) {
|
|
1990
|
+
arg0.fragment = arg1;
|
|
1991
|
+
},
|
|
1992
|
+
__wbg_set_front_face_9c9f0518a3109d98: function(arg0, arg1) {
|
|
1993
|
+
arg0.frontFace = __wbindgen_enum_GpuFrontFace[arg1];
|
|
1994
|
+
},
|
|
1995
|
+
__wbg_set_g_a39877021b450e75: function(arg0, arg1) {
|
|
1996
|
+
arg0.g = arg1;
|
|
1997
|
+
},
|
|
1998
|
+
__wbg_set_has_dynamic_offset_69725fed837748fe: function(arg0, arg1) {
|
|
1999
|
+
arg0.hasDynamicOffset = arg1 !== 0;
|
|
2000
|
+
},
|
|
2001
|
+
__wbg_set_height_0739170de8653cc4: function(arg0, arg1) {
|
|
2002
|
+
arg0.height = arg1 >>> 0;
|
|
2003
|
+
},
|
|
2004
|
+
__wbg_set_height_975770494a218d52: function(arg0, arg1) {
|
|
2005
|
+
arg0.height = arg1 >>> 0;
|
|
2006
|
+
},
|
|
2007
|
+
__wbg_set_height_c661af0c0b5376f9: function(arg0, arg1) {
|
|
2008
|
+
arg0.height = arg1 >>> 0;
|
|
2009
|
+
},
|
|
2010
|
+
__wbg_set_label_26577513096f145b: function(arg0, arg1, arg2) {
|
|
2011
|
+
arg0.label = getStringFromWasm0(arg1, arg2);
|
|
2012
|
+
},
|
|
2013
|
+
__wbg_set_label_2816ddca7866dcfa: function(arg0, arg1, arg2) {
|
|
2014
|
+
arg0.label = getStringFromWasm0(arg1, arg2);
|
|
2015
|
+
},
|
|
2016
|
+
__wbg_set_label_2a41a6f671383447: function(arg0, arg1, arg2) {
|
|
2017
|
+
arg0.label = getStringFromWasm0(arg1, arg2);
|
|
2018
|
+
},
|
|
2019
|
+
__wbg_set_label_325c5e4b70c1568f: function(arg0, arg1, arg2) {
|
|
2020
|
+
arg0.label = getStringFromWasm0(arg1, arg2);
|
|
2021
|
+
},
|
|
2022
|
+
__wbg_set_label_37d0faa0c9b7dee4: function(arg0, arg1, arg2) {
|
|
2023
|
+
arg0.label = getStringFromWasm0(arg1, arg2);
|
|
2024
|
+
},
|
|
2025
|
+
__wbg_set_label_3e306b2e8f9db666: function(arg0, arg1, arg2) {
|
|
2026
|
+
arg0.label = getStringFromWasm0(arg1, arg2);
|
|
2027
|
+
},
|
|
2028
|
+
__wbg_set_label_5514e44725004e89: function(arg0, arg1, arg2) {
|
|
2029
|
+
arg0.label = getStringFromWasm0(arg1, arg2);
|
|
2030
|
+
},
|
|
2031
|
+
__wbg_set_label_570d3dee0e80279e: function(arg0, arg1, arg2) {
|
|
2032
|
+
arg0.label = getStringFromWasm0(arg1, arg2);
|
|
2033
|
+
},
|
|
2034
|
+
__wbg_set_label_58fbc9fcc6363f16: function(arg0, arg1, arg2) {
|
|
2035
|
+
arg0.label = getStringFromWasm0(arg1, arg2);
|
|
2036
|
+
},
|
|
2037
|
+
__wbg_set_label_5c952448f9d59f36: function(arg0, arg1, arg2) {
|
|
2038
|
+
arg0.label = getStringFromWasm0(arg1, arg2);
|
|
2039
|
+
},
|
|
2040
|
+
__wbg_set_label_782e33de78d86641: function(arg0, arg1, arg2) {
|
|
2041
|
+
arg0.label = getStringFromWasm0(arg1, arg2);
|
|
2042
|
+
},
|
|
2043
|
+
__wbg_set_label_837a3b8ff99c2db3: function(arg0, arg1, arg2) {
|
|
2044
|
+
arg0.label = getStringFromWasm0(arg1, arg2);
|
|
2045
|
+
},
|
|
2046
|
+
__wbg_set_label_8df6673e1e141fcc: function(arg0, arg1, arg2) {
|
|
2047
|
+
arg0.label = getStringFromWasm0(arg1, arg2);
|
|
2048
|
+
},
|
|
2049
|
+
__wbg_set_layout_a6ee8e74696bc0c8: function(arg0, arg1) {
|
|
2050
|
+
arg0.layout = arg1;
|
|
2051
|
+
},
|
|
2052
|
+
__wbg_set_layout_d701bf37a1e489c6: function(arg0, arg1) {
|
|
2053
|
+
arg0.layout = arg1;
|
|
2054
|
+
},
|
|
2055
|
+
__wbg_set_load_op_e8ff3e1c81f7398d: function(arg0, arg1) {
|
|
2056
|
+
arg0.loadOp = __wbindgen_enum_GpuLoadOp[arg1];
|
|
2057
|
+
},
|
|
2058
|
+
__wbg_set_lod_max_clamp_a9f93b2e2ae9023d: function(arg0, arg1) {
|
|
2059
|
+
arg0.lodMaxClamp = arg1;
|
|
2060
|
+
},
|
|
2061
|
+
__wbg_set_lod_min_clamp_342b47161f1fa002: function(arg0, arg1) {
|
|
2062
|
+
arg0.lodMinClamp = arg1;
|
|
2063
|
+
},
|
|
2064
|
+
__wbg_set_mag_filter_28e863ff1a386f86: function(arg0, arg1) {
|
|
2065
|
+
arg0.magFilter = __wbindgen_enum_GpuFilterMode[arg1];
|
|
2066
|
+
},
|
|
2067
|
+
__wbg_set_mapped_at_creation_7f0aad21612f3e22: function(arg0, arg1) {
|
|
2068
|
+
arg0.mappedAtCreation = arg1 !== 0;
|
|
2069
|
+
},
|
|
2070
|
+
__wbg_set_mask_a18cbdfc03a4cbd9: function(arg0, arg1) {
|
|
2071
|
+
arg0.mask = arg1 >>> 0;
|
|
2072
|
+
},
|
|
2073
|
+
__wbg_set_max_anisotropy_19e574a7e9cb009a: function(arg0, arg1) {
|
|
2074
|
+
arg0.maxAnisotropy = arg1;
|
|
2075
|
+
},
|
|
2076
|
+
__wbg_set_min_binding_size_d70e460d165d9144: function(arg0, arg1) {
|
|
2077
|
+
arg0.minBindingSize = arg1;
|
|
2078
|
+
},
|
|
2079
|
+
__wbg_set_min_filter_5275c8a3815f9f0c: function(arg0, arg1) {
|
|
2080
|
+
arg0.minFilter = __wbindgen_enum_GpuFilterMode[arg1];
|
|
2081
|
+
},
|
|
2082
|
+
__wbg_set_mip_level_8d4dfc5d506cb37f: function(arg0, arg1) {
|
|
2083
|
+
arg0.mipLevel = arg1 >>> 0;
|
|
2084
|
+
},
|
|
2085
|
+
__wbg_set_mip_level_count_04af0d33c4905fac: function(arg0, arg1) {
|
|
2086
|
+
arg0.mipLevelCount = arg1 >>> 0;
|
|
2087
|
+
},
|
|
2088
|
+
__wbg_set_mip_level_count_dcb2ad32716506a5: function(arg0, arg1) {
|
|
2089
|
+
arg0.mipLevelCount = arg1 >>> 0;
|
|
2090
|
+
},
|
|
2091
|
+
__wbg_set_mipmap_filter_ae5e0e814693019b: function(arg0, arg1) {
|
|
2092
|
+
arg0.mipmapFilter = __wbindgen_enum_GpuMipmapFilterMode[arg1];
|
|
2093
|
+
},
|
|
2094
|
+
__wbg_set_module_0933874708065f3b: function(arg0, arg1) {
|
|
2095
|
+
arg0.module = arg1;
|
|
2096
|
+
},
|
|
2097
|
+
__wbg_set_module_a7a131494850e5f7: function(arg0, arg1) {
|
|
2098
|
+
arg0.module = arg1;
|
|
2099
|
+
},
|
|
2100
|
+
__wbg_set_multisample_e857cbfca335c7f1: function(arg0, arg1) {
|
|
2101
|
+
arg0.multisample = arg1;
|
|
2102
|
+
},
|
|
2103
|
+
__wbg_set_multisampled_4ce4c32144215354: function(arg0, arg1) {
|
|
2104
|
+
arg0.multisampled = arg1 !== 0;
|
|
2105
|
+
},
|
|
2106
|
+
__wbg_set_offset_baf6780761c43b24: function(arg0, arg1) {
|
|
2107
|
+
arg0.offset = arg1;
|
|
2108
|
+
},
|
|
2109
|
+
__wbg_set_offset_e316586bb85f0bd6: function(arg0, arg1) {
|
|
2110
|
+
arg0.offset = arg1;
|
|
2111
|
+
},
|
|
2112
|
+
__wbg_set_offset_eabaf12fe1c98ce7: function(arg0, arg1) {
|
|
2113
|
+
arg0.offset = arg1;
|
|
2114
|
+
},
|
|
2115
|
+
__wbg_set_operation_a91e5763a8313c6b: function(arg0, arg1) {
|
|
2116
|
+
arg0.operation = __wbindgen_enum_GpuBlendOperation[arg1];
|
|
2117
|
+
},
|
|
2118
|
+
__wbg_set_origin_24a61b4427e330e9: function(arg0, arg1) {
|
|
2119
|
+
arg0.origin = arg1;
|
|
2120
|
+
},
|
|
2121
|
+
__wbg_set_pass_op_eef0c5885ae707c3: function(arg0, arg1) {
|
|
2122
|
+
arg0.passOp = __wbindgen_enum_GpuStencilOperation[arg1];
|
|
2123
|
+
},
|
|
2124
|
+
__wbg_set_power_preference_7d669fb9b41f7bf2: function(arg0, arg1) {
|
|
2125
|
+
arg0.powerPreference = __wbindgen_enum_GpuPowerPreference[arg1];
|
|
2126
|
+
},
|
|
2127
|
+
__wbg_set_primitive_3462e090c7a78969: function(arg0, arg1) {
|
|
2128
|
+
arg0.primitive = arg1;
|
|
2129
|
+
},
|
|
2130
|
+
__wbg_set_query_set_62d86bdf10d64d37: function(arg0, arg1) {
|
|
2131
|
+
arg0.querySet = arg1;
|
|
2132
|
+
},
|
|
2133
|
+
__wbg_set_r_40fe44b2d9a401f4: function(arg0, arg1) {
|
|
2134
|
+
arg0.r = arg1;
|
|
2135
|
+
},
|
|
2136
|
+
__wbg_set_required_features_3d00070d09235d7d: function(arg0, arg1) {
|
|
2137
|
+
arg0.requiredFeatures = arg1;
|
|
2138
|
+
},
|
|
2139
|
+
__wbg_set_required_limits_e0de55a49a48e3dc: function(arg0, arg1) {
|
|
2140
|
+
arg0.requiredLimits = arg1;
|
|
2141
|
+
},
|
|
2142
|
+
__wbg_set_resolve_target_6e7eda03a6886624: function(arg0, arg1) {
|
|
2143
|
+
arg0.resolveTarget = arg1;
|
|
2144
|
+
},
|
|
2145
|
+
__wbg_set_resource_fe1f979fce4afee2: function(arg0, arg1) {
|
|
2146
|
+
arg0.resource = arg1;
|
|
2147
|
+
},
|
|
2148
|
+
__wbg_set_rows_per_image_c616c70e60a35618: function(arg0, arg1) {
|
|
2149
|
+
arg0.rowsPerImage = arg1 >>> 0;
|
|
2150
|
+
},
|
|
2151
|
+
__wbg_set_sample_count_2b8ac49e1626ac13: function(arg0, arg1) {
|
|
2152
|
+
arg0.sampleCount = arg1 >>> 0;
|
|
2153
|
+
},
|
|
2154
|
+
__wbg_set_sample_type_3cecbd4699e2e5fb: function(arg0, arg1) {
|
|
2155
|
+
arg0.sampleType = __wbindgen_enum_GpuTextureSampleType[arg1];
|
|
2156
|
+
},
|
|
2157
|
+
__wbg_set_sampler_12544c21977075c1: function(arg0, arg1) {
|
|
2158
|
+
arg0.sampler = arg1;
|
|
2159
|
+
},
|
|
2160
|
+
__wbg_set_shader_location_03356bf6a6da4332: function(arg0, arg1) {
|
|
2161
|
+
arg0.shaderLocation = arg1 >>> 0;
|
|
2162
|
+
},
|
|
2163
|
+
__wbg_set_size_0c20f73abce8f1ce: function(arg0, arg1) {
|
|
2164
|
+
arg0.size = arg1;
|
|
2165
|
+
},
|
|
2166
|
+
__wbg_set_size_cf04b4174c30722b: function(arg0, arg1) {
|
|
2167
|
+
arg0.size = arg1;
|
|
2168
|
+
},
|
|
2169
|
+
__wbg_set_size_f1207de283144c72: function(arg0, arg1) {
|
|
2170
|
+
arg0.size = arg1;
|
|
2171
|
+
},
|
|
2172
|
+
__wbg_set_src_factor_c3668d4122497276: function(arg0, arg1) {
|
|
2173
|
+
arg0.srcFactor = __wbindgen_enum_GpuBlendFactor[arg1];
|
|
2174
|
+
},
|
|
2175
|
+
__wbg_set_stencil_back_8d01a6c0477059b0: function(arg0, arg1) {
|
|
2176
|
+
arg0.stencilBack = arg1;
|
|
2177
|
+
},
|
|
2178
|
+
__wbg_set_stencil_clear_value_1f380af0bd0d9255: function(arg0, arg1) {
|
|
2179
|
+
arg0.stencilClearValue = arg1 >>> 0;
|
|
2180
|
+
},
|
|
2181
|
+
__wbg_set_stencil_front_f881c15b2d170653: function(arg0, arg1) {
|
|
2182
|
+
arg0.stencilFront = arg1;
|
|
2183
|
+
},
|
|
2184
|
+
__wbg_set_stencil_load_op_5cde31e71a964b58: function(arg0, arg1) {
|
|
2185
|
+
arg0.stencilLoadOp = __wbindgen_enum_GpuLoadOp[arg1];
|
|
2186
|
+
},
|
|
2187
|
+
__wbg_set_stencil_read_mask_d79993adcfc418ab: function(arg0, arg1) {
|
|
2188
|
+
arg0.stencilReadMask = arg1 >>> 0;
|
|
2189
|
+
},
|
|
2190
|
+
__wbg_set_stencil_read_only_ac984029b821315e: function(arg0, arg1) {
|
|
2191
|
+
arg0.stencilReadOnly = arg1 !== 0;
|
|
2192
|
+
},
|
|
2193
|
+
__wbg_set_stencil_store_op_262e1df7b92404d3: function(arg0, arg1) {
|
|
2194
|
+
arg0.stencilStoreOp = __wbindgen_enum_GpuStoreOp[arg1];
|
|
2195
|
+
},
|
|
2196
|
+
__wbg_set_stencil_write_mask_94ec6249877e083e: function(arg0, arg1) {
|
|
2197
|
+
arg0.stencilWriteMask = arg1 >>> 0;
|
|
2198
|
+
},
|
|
2199
|
+
__wbg_set_step_mode_241a8d5515fa964b: function(arg0, arg1) {
|
|
2200
|
+
arg0.stepMode = __wbindgen_enum_GpuVertexStepMode[arg1];
|
|
2201
|
+
},
|
|
2202
|
+
__wbg_set_storage_texture_36be4834c501acab: function(arg0, arg1) {
|
|
2203
|
+
arg0.storageTexture = arg1;
|
|
2204
|
+
},
|
|
2205
|
+
__wbg_set_store_op_a95e8da4555c6010: function(arg0, arg1) {
|
|
2206
|
+
arg0.storeOp = __wbindgen_enum_GpuStoreOp[arg1];
|
|
2207
|
+
},
|
|
2208
|
+
__wbg_set_strip_index_format_62c417aa65a4d277: function(arg0, arg1) {
|
|
2209
|
+
arg0.stripIndexFormat = __wbindgen_enum_GpuIndexFormat[arg1];
|
|
2210
|
+
},
|
|
2211
|
+
__wbg_set_targets_6664b7e6ec5da9d3: function(arg0, arg1) {
|
|
2212
|
+
arg0.targets = arg1;
|
|
2213
|
+
},
|
|
2214
|
+
__wbg_set_texture_64823aa8aca790b5: function(arg0, arg1) {
|
|
2215
|
+
arg0.texture = arg1;
|
|
2216
|
+
},
|
|
2217
|
+
__wbg_set_texture_738e6f6215515de3: function(arg0, arg1) {
|
|
2218
|
+
arg0.texture = arg1;
|
|
2219
|
+
},
|
|
2220
|
+
__wbg_set_timestamp_writes_3854a564715b0ac7: function(arg0, arg1) {
|
|
2221
|
+
arg0.timestampWrites = arg1;
|
|
2222
|
+
},
|
|
2223
|
+
__wbg_set_topology_914716698f5868bb: function(arg0, arg1) {
|
|
2224
|
+
arg0.topology = __wbindgen_enum_GpuPrimitiveTopology[arg1];
|
|
2225
|
+
},
|
|
2226
|
+
__wbg_set_type_17a1387b620bc902: function(arg0, arg1) {
|
|
2227
|
+
arg0.type = __wbindgen_enum_GpuBufferBindingType[arg1];
|
|
2228
|
+
},
|
|
2229
|
+
__wbg_set_type_d4edb621ec2051e0: function(arg0, arg1) {
|
|
2230
|
+
arg0.type = __wbindgen_enum_GpuSamplerBindingType[arg1];
|
|
2231
|
+
},
|
|
2232
|
+
__wbg_set_unclipped_depth_e23e3091db2ac351: function(arg0, arg1) {
|
|
2233
|
+
arg0.unclippedDepth = arg1 !== 0;
|
|
2234
|
+
},
|
|
2235
|
+
__wbg_set_usage_41b7d18f3f220e6c: function(arg0, arg1) {
|
|
2236
|
+
arg0.usage = arg1 >>> 0;
|
|
2237
|
+
},
|
|
2238
|
+
__wbg_set_usage_6ae4d85589906117: function(arg0, arg1) {
|
|
2239
|
+
arg0.usage = arg1 >>> 0;
|
|
2240
|
+
},
|
|
2241
|
+
__wbg_set_usage_e167dd772123f679: function(arg0, arg1) {
|
|
2242
|
+
arg0.usage = arg1 >>> 0;
|
|
2243
|
+
},
|
|
2244
|
+
__wbg_set_usage_f084cd416060ceee: function(arg0, arg1) {
|
|
2245
|
+
arg0.usage = arg1 >>> 0;
|
|
2246
|
+
},
|
|
2247
|
+
__wbg_set_vertex_29812f650590fa45: function(arg0, arg1) {
|
|
2248
|
+
arg0.vertex = arg1;
|
|
2249
|
+
},
|
|
2250
|
+
__wbg_set_view_32a8132aec6de194: function(arg0, arg1) {
|
|
2251
|
+
arg0.view = arg1;
|
|
2252
|
+
},
|
|
2253
|
+
__wbg_set_view_506e5beadab34e99: function(arg0, arg1) {
|
|
2254
|
+
arg0.view = arg1;
|
|
2255
|
+
},
|
|
2256
|
+
__wbg_set_view_dimension_4a840560a13b4860: function(arg0, arg1) {
|
|
2257
|
+
arg0.viewDimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
|
|
2258
|
+
},
|
|
2259
|
+
__wbg_set_view_dimension_9ae69db849267b1a: function(arg0, arg1) {
|
|
2260
|
+
arg0.viewDimension = __wbindgen_enum_GpuTextureViewDimension[arg1];
|
|
2261
|
+
},
|
|
2262
|
+
__wbg_set_view_formats_4d0b943f593dd219: function(arg0, arg1) {
|
|
2263
|
+
arg0.viewFormats = arg1;
|
|
2264
|
+
},
|
|
2265
|
+
__wbg_set_view_formats_cba8520bf0d83d62: function(arg0, arg1) {
|
|
2266
|
+
arg0.viewFormats = arg1;
|
|
2267
|
+
},
|
|
2268
|
+
__wbg_set_visibility_bbbf3d2b70571950: function(arg0, arg1) {
|
|
2269
|
+
arg0.visibility = arg1 >>> 0;
|
|
2270
|
+
},
|
|
2271
|
+
__wbg_set_width_0f26635b289b3c67: function(arg0, arg1) {
|
|
2272
|
+
arg0.width = arg1 >>> 0;
|
|
2273
|
+
},
|
|
2274
|
+
__wbg_set_width_7ca43f32db1cfe8e: function(arg0, arg1) {
|
|
2275
|
+
arg0.width = arg1 >>> 0;
|
|
2276
|
+
},
|
|
2277
|
+
__wbg_set_width_87301412247f3343: function(arg0, arg1) {
|
|
2278
|
+
arg0.width = arg1 >>> 0;
|
|
2279
|
+
},
|
|
2280
|
+
__wbg_set_write_mask_949f521dcf3da2b5: function(arg0, arg1) {
|
|
2281
|
+
arg0.writeMask = arg1 >>> 0;
|
|
2282
|
+
},
|
|
2283
|
+
__wbg_set_x_15a4c893b3366fab: function(arg0, arg1) {
|
|
2284
|
+
arg0.x = arg1 >>> 0;
|
|
2285
|
+
},
|
|
2286
|
+
__wbg_set_y_c631920a1c51a694: function(arg0, arg1) {
|
|
2287
|
+
arg0.y = arg1 >>> 0;
|
|
2288
|
+
},
|
|
2289
|
+
__wbg_set_z_7c526101c55ea2ae: function(arg0, arg1) {
|
|
2290
|
+
arg0.z = arg1 >>> 0;
|
|
2291
|
+
},
|
|
2292
|
+
__wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
|
|
2293
|
+
const ret = arg1.stack;
|
|
2294
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2295
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2296
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2297
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2298
|
+
},
|
|
2299
|
+
__wbg_static_accessor_GLOBAL_9d53f2689e622ca1: function() {
|
|
2300
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
2301
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2302
|
+
},
|
|
2303
|
+
__wbg_static_accessor_GLOBAL_THIS_a1a35cec07001a8a: function() {
|
|
2304
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
2305
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2306
|
+
},
|
|
2307
|
+
__wbg_static_accessor_SELF_4c59f6c7ea29a144: function() {
|
|
2308
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
2309
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2310
|
+
},
|
|
2311
|
+
__wbg_static_accessor_WINDOW_e70ae9f2eb052253: function() {
|
|
2312
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
2313
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2314
|
+
},
|
|
2315
|
+
__wbg_submit_b3bbead76cbf7627: function(arg0, arg1) {
|
|
2316
|
+
arg0.submit(arg1);
|
|
2317
|
+
},
|
|
2318
|
+
__wbg_then_18f476d590e58992: function(arg0, arg1, arg2) {
|
|
2319
|
+
const ret = arg0.then(arg1, arg2);
|
|
2320
|
+
return ret;
|
|
2321
|
+
},
|
|
2322
|
+
__wbg_then_529ea37d9bdbf95d: function(arg0, arg1, arg2) {
|
|
2323
|
+
const ret = arg0.then(arg1, arg2);
|
|
2324
|
+
return ret;
|
|
2325
|
+
},
|
|
2326
|
+
__wbg_then_ac7b025999b52837: function(arg0, arg1) {
|
|
2327
|
+
const ret = arg0.then(arg1);
|
|
2328
|
+
return ret;
|
|
2329
|
+
},
|
|
2330
|
+
__wbg_viewport_new: function(arg0) {
|
|
2331
|
+
const ret = Viewport.__wrap(arg0);
|
|
2332
|
+
return ret;
|
|
2333
|
+
},
|
|
2334
|
+
__wbg_width_796e38875beab5e6: function(arg0) {
|
|
2335
|
+
const ret = arg0.width;
|
|
2336
|
+
return ret;
|
|
2337
|
+
},
|
|
2338
|
+
__wbg_writeBuffer_24a10bfd5a8a57f7: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
|
|
2339
|
+
arg0.writeBuffer(arg1, arg2, getArrayU8FromWasm0(arg3, arg4), arg5, arg6);
|
|
2340
|
+
}, arguments); },
|
|
2341
|
+
__wbg_writeTexture_acb28796746826c8: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
2342
|
+
arg0.writeTexture(arg1, getArrayU8FromWasm0(arg2, arg3), arg4, arg5);
|
|
2343
|
+
}, arguments); },
|
|
2344
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
2345
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1175, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2346
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hc9b514610e2ea6ee);
|
|
2347
|
+
return ret;
|
|
2348
|
+
},
|
|
2349
|
+
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
2350
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1226, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2351
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h70a5e17d363fcdff);
|
|
2352
|
+
return ret;
|
|
2353
|
+
},
|
|
2354
|
+
__wbindgen_cast_0000000000000003: function(arg0) {
|
|
2355
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
2356
|
+
const ret = arg0;
|
|
2357
|
+
return ret;
|
|
2358
|
+
},
|
|
2359
|
+
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
2360
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
2361
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
2362
|
+
return ret;
|
|
2363
|
+
},
|
|
2364
|
+
__wbindgen_init_externref_table: function() {
|
|
2365
|
+
const table = wasm.__wbindgen_externrefs;
|
|
2366
|
+
const offset = table.grow(4);
|
|
2367
|
+
table.set(0, undefined);
|
|
2368
|
+
table.set(offset + 0, undefined);
|
|
2369
|
+
table.set(offset + 1, null);
|
|
2370
|
+
table.set(offset + 2, true);
|
|
2371
|
+
table.set(offset + 3, false);
|
|
2372
|
+
},
|
|
2373
|
+
};
|
|
2374
|
+
return {
|
|
2375
|
+
__proto__: null,
|
|
2376
|
+
"./nf_wasm_bg.js": import0,
|
|
2377
|
+
};
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
function wasm_bindgen__convert__closures_____invoke__hc9b514610e2ea6ee(arg0, arg1, arg2) {
|
|
2381
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hc9b514610e2ea6ee(arg0, arg1, arg2);
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2384
|
+
function wasm_bindgen__convert__closures_____invoke__h70a5e17d363fcdff(arg0, arg1, arg2) {
|
|
2385
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h70a5e17d363fcdff(arg0, arg1, arg2);
|
|
2386
|
+
if (ret[1]) {
|
|
2387
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2391
|
+
function wasm_bindgen__convert__closures_____invoke__h1ef02cf0d1d48747(arg0, arg1, arg2, arg3) {
|
|
2392
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h1ef02cf0d1d48747(arg0, arg1, arg2, arg3);
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
|
|
2396
|
+
const __wbindgen_enum_GpuAddressMode = ["clamp-to-edge", "repeat", "mirror-repeat"];
|
|
2397
|
+
|
|
2398
|
+
|
|
2399
|
+
const __wbindgen_enum_GpuBlendFactor = ["zero", "one", "src", "one-minus-src", "src-alpha", "one-minus-src-alpha", "dst", "one-minus-dst", "dst-alpha", "one-minus-dst-alpha", "src-alpha-saturated", "constant", "one-minus-constant", "src1", "one-minus-src1", "src1-alpha", "one-minus-src1-alpha"];
|
|
2400
|
+
|
|
2401
|
+
|
|
2402
|
+
const __wbindgen_enum_GpuBlendOperation = ["add", "subtract", "reverse-subtract", "min", "max"];
|
|
2403
|
+
|
|
2404
|
+
|
|
2405
|
+
const __wbindgen_enum_GpuBufferBindingType = ["uniform", "storage", "read-only-storage"];
|
|
2406
|
+
|
|
2407
|
+
|
|
2408
|
+
const __wbindgen_enum_GpuCanvasAlphaMode = ["opaque", "premultiplied"];
|
|
2409
|
+
|
|
2410
|
+
|
|
2411
|
+
const __wbindgen_enum_GpuCompareFunction = ["never", "less", "equal", "less-equal", "greater", "not-equal", "greater-equal", "always"];
|
|
2412
|
+
|
|
2413
|
+
|
|
2414
|
+
const __wbindgen_enum_GpuCullMode = ["none", "front", "back"];
|
|
2415
|
+
|
|
2416
|
+
|
|
2417
|
+
const __wbindgen_enum_GpuErrorFilter = ["validation", "out-of-memory", "internal"];
|
|
2418
|
+
|
|
2419
|
+
|
|
2420
|
+
const __wbindgen_enum_GpuFilterMode = ["nearest", "linear"];
|
|
2421
|
+
|
|
2422
|
+
|
|
2423
|
+
const __wbindgen_enum_GpuFrontFace = ["ccw", "cw"];
|
|
2424
|
+
|
|
2425
|
+
|
|
2426
|
+
const __wbindgen_enum_GpuIndexFormat = ["uint16", "uint32"];
|
|
2427
|
+
|
|
2428
|
+
|
|
2429
|
+
const __wbindgen_enum_GpuLoadOp = ["load", "clear"];
|
|
2430
|
+
|
|
2431
|
+
|
|
2432
|
+
const __wbindgen_enum_GpuMipmapFilterMode = ["nearest", "linear"];
|
|
2433
|
+
|
|
2434
|
+
|
|
2435
|
+
const __wbindgen_enum_GpuPowerPreference = ["low-power", "high-performance"];
|
|
2436
|
+
|
|
2437
|
+
|
|
2438
|
+
const __wbindgen_enum_GpuPrimitiveTopology = ["point-list", "line-list", "line-strip", "triangle-list", "triangle-strip"];
|
|
2439
|
+
|
|
2440
|
+
|
|
2441
|
+
const __wbindgen_enum_GpuSamplerBindingType = ["filtering", "non-filtering", "comparison"];
|
|
2442
|
+
|
|
2443
|
+
|
|
2444
|
+
const __wbindgen_enum_GpuStencilOperation = ["keep", "zero", "replace", "invert", "increment-clamp", "decrement-clamp", "increment-wrap", "decrement-wrap"];
|
|
2445
|
+
|
|
2446
|
+
|
|
2447
|
+
const __wbindgen_enum_GpuStorageTextureAccess = ["write-only", "read-only", "read-write"];
|
|
2448
|
+
|
|
2449
|
+
|
|
2450
|
+
const __wbindgen_enum_GpuStoreOp = ["store", "discard"];
|
|
2451
|
+
|
|
2452
|
+
|
|
2453
|
+
const __wbindgen_enum_GpuTextureAspect = ["all", "stencil-only", "depth-only"];
|
|
2454
|
+
|
|
2455
|
+
|
|
2456
|
+
const __wbindgen_enum_GpuTextureDimension = ["1d", "2d", "3d"];
|
|
2457
|
+
|
|
2458
|
+
|
|
2459
|
+
const __wbindgen_enum_GpuTextureFormat = ["r8unorm", "r8snorm", "r8uint", "r8sint", "r16uint", "r16sint", "r16float", "rg8unorm", "rg8snorm", "rg8uint", "rg8sint", "r32uint", "r32sint", "r32float", "rg16uint", "rg16sint", "rg16float", "rgba8unorm", "rgba8unorm-srgb", "rgba8snorm", "rgba8uint", "rgba8sint", "bgra8unorm", "bgra8unorm-srgb", "rgb9e5ufloat", "rgb10a2uint", "rgb10a2unorm", "rg11b10ufloat", "rg32uint", "rg32sint", "rg32float", "rgba16uint", "rgba16sint", "rgba16float", "rgba32uint", "rgba32sint", "rgba32float", "stencil8", "depth16unorm", "depth24plus", "depth24plus-stencil8", "depth32float", "depth32float-stencil8", "bc1-rgba-unorm", "bc1-rgba-unorm-srgb", "bc2-rgba-unorm", "bc2-rgba-unorm-srgb", "bc3-rgba-unorm", "bc3-rgba-unorm-srgb", "bc4-r-unorm", "bc4-r-snorm", "bc5-rg-unorm", "bc5-rg-snorm", "bc6h-rgb-ufloat", "bc6h-rgb-float", "bc7-rgba-unorm", "bc7-rgba-unorm-srgb", "etc2-rgb8unorm", "etc2-rgb8unorm-srgb", "etc2-rgb8a1unorm", "etc2-rgb8a1unorm-srgb", "etc2-rgba8unorm", "etc2-rgba8unorm-srgb", "eac-r11unorm", "eac-r11snorm", "eac-rg11unorm", "eac-rg11snorm", "astc-4x4-unorm", "astc-4x4-unorm-srgb", "astc-5x4-unorm", "astc-5x4-unorm-srgb", "astc-5x5-unorm", "astc-5x5-unorm-srgb", "astc-6x5-unorm", "astc-6x5-unorm-srgb", "astc-6x6-unorm", "astc-6x6-unorm-srgb", "astc-8x5-unorm", "astc-8x5-unorm-srgb", "astc-8x6-unorm", "astc-8x6-unorm-srgb", "astc-8x8-unorm", "astc-8x8-unorm-srgb", "astc-10x5-unorm", "astc-10x5-unorm-srgb", "astc-10x6-unorm", "astc-10x6-unorm-srgb", "astc-10x8-unorm", "astc-10x8-unorm-srgb", "astc-10x10-unorm", "astc-10x10-unorm-srgb", "astc-12x10-unorm", "astc-12x10-unorm-srgb", "astc-12x12-unorm", "astc-12x12-unorm-srgb"];
|
|
2460
|
+
|
|
2461
|
+
|
|
2462
|
+
const __wbindgen_enum_GpuTextureSampleType = ["float", "unfilterable-float", "depth", "sint", "uint"];
|
|
2463
|
+
|
|
2464
|
+
|
|
2465
|
+
const __wbindgen_enum_GpuTextureViewDimension = ["1d", "2d", "2d-array", "cube", "cube-array", "3d"];
|
|
2466
|
+
|
|
2467
|
+
|
|
2468
|
+
const __wbindgen_enum_GpuVertexFormat = ["uint8", "uint8x2", "uint8x4", "sint8", "sint8x2", "sint8x4", "unorm8", "unorm8x2", "unorm8x4", "snorm8", "snorm8x2", "snorm8x4", "uint16", "uint16x2", "uint16x4", "sint16", "sint16x2", "sint16x4", "unorm16", "unorm16x2", "unorm16x4", "snorm16", "snorm16x2", "snorm16x4", "float16", "float16x2", "float16x4", "float32", "float32x2", "float32x3", "float32x4", "uint32", "uint32x2", "uint32x3", "uint32x4", "sint32", "sint32x2", "sint32x3", "sint32x4", "unorm10-10-10-2", "unorm8x4-bgra"];
|
|
2469
|
+
|
|
2470
|
+
|
|
2471
|
+
const __wbindgen_enum_GpuVertexStepMode = ["vertex", "instance"];
|
|
2472
|
+
const EngineFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2473
|
+
? { register: () => {}, unregister: () => {} }
|
|
2474
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_engine_free(ptr, 1));
|
|
2475
|
+
const ViewportFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2476
|
+
? { register: () => {}, unregister: () => {} }
|
|
2477
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_viewport_free(ptr, 1));
|
|
2478
|
+
|
|
2479
|
+
function addToExternrefTable0(obj) {
|
|
2480
|
+
const idx = wasm.__externref_table_alloc();
|
|
2481
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
2482
|
+
return idx;
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2485
|
+
function _assertClass(instance, klass) {
|
|
2486
|
+
if (!(instance instanceof klass)) {
|
|
2487
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2490
|
+
|
|
2491
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
2492
|
+
? { register: () => {}, unregister: () => {} }
|
|
2493
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
|
|
2494
|
+
|
|
2495
|
+
function debugString(val) {
|
|
2496
|
+
// primitive types
|
|
2497
|
+
const type = typeof val;
|
|
2498
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
2499
|
+
return `${val}`;
|
|
2500
|
+
}
|
|
2501
|
+
if (type == 'string') {
|
|
2502
|
+
return `"${val}"`;
|
|
2503
|
+
}
|
|
2504
|
+
if (type == 'symbol') {
|
|
2505
|
+
const description = val.description;
|
|
2506
|
+
if (description == null) {
|
|
2507
|
+
return 'Symbol';
|
|
2508
|
+
} else {
|
|
2509
|
+
return `Symbol(${description})`;
|
|
2510
|
+
}
|
|
2511
|
+
}
|
|
2512
|
+
if (type == 'function') {
|
|
2513
|
+
const name = val.name;
|
|
2514
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
2515
|
+
return `Function(${name})`;
|
|
2516
|
+
} else {
|
|
2517
|
+
return 'Function';
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
// objects
|
|
2521
|
+
if (Array.isArray(val)) {
|
|
2522
|
+
const length = val.length;
|
|
2523
|
+
let debug = '[';
|
|
2524
|
+
if (length > 0) {
|
|
2525
|
+
debug += debugString(val[0]);
|
|
2526
|
+
}
|
|
2527
|
+
for(let i = 1; i < length; i++) {
|
|
2528
|
+
debug += ', ' + debugString(val[i]);
|
|
2529
|
+
}
|
|
2530
|
+
debug += ']';
|
|
2531
|
+
return debug;
|
|
2532
|
+
}
|
|
2533
|
+
// Test for built-in
|
|
2534
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
2535
|
+
let className;
|
|
2536
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
2537
|
+
className = builtInMatches[1];
|
|
2538
|
+
} else {
|
|
2539
|
+
// Failed to match the standard '[object ClassName]'
|
|
2540
|
+
return toString.call(val);
|
|
2541
|
+
}
|
|
2542
|
+
if (className == 'Object') {
|
|
2543
|
+
// we're a user defined class or Object
|
|
2544
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
2545
|
+
// easier than looping through ownProperties of `val`.
|
|
2546
|
+
try {
|
|
2547
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
2548
|
+
} catch (_) {
|
|
2549
|
+
return 'Object';
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
// errors
|
|
2553
|
+
if (val instanceof Error) {
|
|
2554
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
2555
|
+
}
|
|
2556
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
2557
|
+
return className;
|
|
2558
|
+
}
|
|
2559
|
+
|
|
2560
|
+
function getArrayF32FromWasm0(ptr, len) {
|
|
2561
|
+
ptr = ptr >>> 0;
|
|
2562
|
+
return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
function getArrayF64FromWasm0(ptr, len) {
|
|
2566
|
+
ptr = ptr >>> 0;
|
|
2567
|
+
return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
|
|
2568
|
+
}
|
|
2569
|
+
|
|
2570
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
2571
|
+
ptr = ptr >>> 0;
|
|
2572
|
+
const mem = getDataViewMemory0();
|
|
2573
|
+
const result = [];
|
|
2574
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
2575
|
+
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
2576
|
+
}
|
|
2577
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
2578
|
+
return result;
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
2582
|
+
ptr = ptr >>> 0;
|
|
2583
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
2584
|
+
}
|
|
2585
|
+
|
|
2586
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
2587
|
+
ptr = ptr >>> 0;
|
|
2588
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
let cachedDataViewMemory0 = null;
|
|
2592
|
+
function getDataViewMemory0() {
|
|
2593
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
2594
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
2595
|
+
}
|
|
2596
|
+
return cachedDataViewMemory0;
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
let cachedFloat32ArrayMemory0 = null;
|
|
2600
|
+
function getFloat32ArrayMemory0() {
|
|
2601
|
+
if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
|
|
2602
|
+
cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
|
|
2603
|
+
}
|
|
2604
|
+
return cachedFloat32ArrayMemory0;
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
let cachedFloat64ArrayMemory0 = null;
|
|
2608
|
+
function getFloat64ArrayMemory0() {
|
|
2609
|
+
if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
|
|
2610
|
+
cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
|
|
2611
|
+
}
|
|
2612
|
+
return cachedFloat64ArrayMemory0;
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
function getStringFromWasm0(ptr, len) {
|
|
2616
|
+
return decodeText(ptr >>> 0, len);
|
|
2617
|
+
}
|
|
2618
|
+
|
|
2619
|
+
let cachedUint32ArrayMemory0 = null;
|
|
2620
|
+
function getUint32ArrayMemory0() {
|
|
2621
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
2622
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
2623
|
+
}
|
|
2624
|
+
return cachedUint32ArrayMemory0;
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
let cachedUint8ArrayMemory0 = null;
|
|
2628
|
+
function getUint8ArrayMemory0() {
|
|
2629
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
2630
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
2631
|
+
}
|
|
2632
|
+
return cachedUint8ArrayMemory0;
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
function handleError(f, args) {
|
|
2636
|
+
try {
|
|
2637
|
+
return f.apply(this, args);
|
|
2638
|
+
} catch (e) {
|
|
2639
|
+
const idx = addToExternrefTable0(e);
|
|
2640
|
+
wasm.__wbindgen_exn_store(idx);
|
|
2641
|
+
}
|
|
2642
|
+
}
|
|
2643
|
+
|
|
2644
|
+
function isLikeNone(x) {
|
|
2645
|
+
return x === undefined || x === null;
|
|
2646
|
+
}
|
|
2647
|
+
|
|
2648
|
+
function makeMutClosure(arg0, arg1, f) {
|
|
2649
|
+
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
2650
|
+
const real = (...args) => {
|
|
2651
|
+
|
|
2652
|
+
// First up with a closure we increment the internal reference
|
|
2653
|
+
// count. This ensures that the Rust closure environment won't
|
|
2654
|
+
// be deallocated while we're invoking it.
|
|
2655
|
+
state.cnt++;
|
|
2656
|
+
const a = state.a;
|
|
2657
|
+
state.a = 0;
|
|
2658
|
+
try {
|
|
2659
|
+
return f(a, state.b, ...args);
|
|
2660
|
+
} finally {
|
|
2661
|
+
state.a = a;
|
|
2662
|
+
real._wbg_cb_unref();
|
|
2663
|
+
}
|
|
2664
|
+
};
|
|
2665
|
+
real._wbg_cb_unref = () => {
|
|
2666
|
+
if (--state.cnt === 0) {
|
|
2667
|
+
wasm.__wbindgen_destroy_closure(state.a, state.b);
|
|
2668
|
+
state.a = 0;
|
|
2669
|
+
CLOSURE_DTORS.unregister(state);
|
|
2670
|
+
}
|
|
2671
|
+
};
|
|
2672
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
2673
|
+
return real;
|
|
2674
|
+
}
|
|
2675
|
+
|
|
2676
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
2677
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
2678
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
2679
|
+
WASM_VECTOR_LEN = arg.length;
|
|
2680
|
+
return ptr;
|
|
2681
|
+
}
|
|
2682
|
+
|
|
2683
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
2684
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
2685
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
2686
|
+
WASM_VECTOR_LEN = arg.length;
|
|
2687
|
+
return ptr;
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
function passArrayF32ToWasm0(arg, malloc) {
|
|
2691
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
2692
|
+
getFloat32ArrayMemory0().set(arg, ptr / 4);
|
|
2693
|
+
WASM_VECTOR_LEN = arg.length;
|
|
2694
|
+
return ptr;
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2697
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
2698
|
+
if (realloc === undefined) {
|
|
2699
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
2700
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
2701
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
2702
|
+
WASM_VECTOR_LEN = buf.length;
|
|
2703
|
+
return ptr;
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2706
|
+
let len = arg.length;
|
|
2707
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
2708
|
+
|
|
2709
|
+
const mem = getUint8ArrayMemory0();
|
|
2710
|
+
|
|
2711
|
+
let offset = 0;
|
|
2712
|
+
|
|
2713
|
+
for (; offset < len; offset++) {
|
|
2714
|
+
const code = arg.charCodeAt(offset);
|
|
2715
|
+
if (code > 0x7F) break;
|
|
2716
|
+
mem[ptr + offset] = code;
|
|
2717
|
+
}
|
|
2718
|
+
if (offset !== len) {
|
|
2719
|
+
if (offset !== 0) {
|
|
2720
|
+
arg = arg.slice(offset);
|
|
2721
|
+
}
|
|
2722
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
2723
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
2724
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
2725
|
+
|
|
2726
|
+
offset += ret.written;
|
|
2727
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
WASM_VECTOR_LEN = offset;
|
|
2731
|
+
return ptr;
|
|
2732
|
+
}
|
|
2733
|
+
|
|
2734
|
+
function takeFromExternrefTable0(idx) {
|
|
2735
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
2736
|
+
wasm.__externref_table_dealloc(idx);
|
|
2737
|
+
return value;
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2741
|
+
cachedTextDecoder.decode();
|
|
2742
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
2743
|
+
let numBytesDecoded = 0;
|
|
2744
|
+
function decodeText(ptr, len) {
|
|
2745
|
+
numBytesDecoded += len;
|
|
2746
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
2747
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2748
|
+
cachedTextDecoder.decode();
|
|
2749
|
+
numBytesDecoded = len;
|
|
2750
|
+
}
|
|
2751
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
2752
|
+
}
|
|
2753
|
+
|
|
2754
|
+
const cachedTextEncoder = new TextEncoder();
|
|
2755
|
+
|
|
2756
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
2757
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
2758
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
2759
|
+
view.set(buf);
|
|
2760
|
+
return {
|
|
2761
|
+
read: arg.length,
|
|
2762
|
+
written: buf.length
|
|
2763
|
+
};
|
|
2764
|
+
};
|
|
2765
|
+
}
|
|
2766
|
+
|
|
2767
|
+
let WASM_VECTOR_LEN = 0;
|
|
2768
|
+
|
|
2769
|
+
let wasmModule, wasmInstance, wasm;
|
|
2770
|
+
function __wbg_finalize_init(instance, module) {
|
|
2771
|
+
wasmInstance = instance;
|
|
2772
|
+
wasm = instance.exports;
|
|
2773
|
+
wasmModule = module;
|
|
2774
|
+
cachedDataViewMemory0 = null;
|
|
2775
|
+
cachedFloat32ArrayMemory0 = null;
|
|
2776
|
+
cachedFloat64ArrayMemory0 = null;
|
|
2777
|
+
cachedUint32ArrayMemory0 = null;
|
|
2778
|
+
cachedUint8ArrayMemory0 = null;
|
|
2779
|
+
wasm.__wbindgen_start();
|
|
2780
|
+
return wasm;
|
|
2781
|
+
}
|
|
2782
|
+
|
|
2783
|
+
async function __wbg_load(module, imports) {
|
|
2784
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
2785
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
2786
|
+
try {
|
|
2787
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
2788
|
+
} catch (e) {
|
|
2789
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
2790
|
+
|
|
2791
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
2792
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
2793
|
+
|
|
2794
|
+
} else { throw e; }
|
|
2795
|
+
}
|
|
2796
|
+
}
|
|
2797
|
+
|
|
2798
|
+
const bytes = await module.arrayBuffer();
|
|
2799
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
2800
|
+
} else {
|
|
2801
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
2802
|
+
|
|
2803
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
2804
|
+
return { instance, module };
|
|
2805
|
+
} else {
|
|
2806
|
+
return instance;
|
|
2807
|
+
}
|
|
2808
|
+
}
|
|
2809
|
+
|
|
2810
|
+
function expectedResponseType(type) {
|
|
2811
|
+
switch (type) {
|
|
2812
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
2813
|
+
}
|
|
2814
|
+
return false;
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
|
|
2818
|
+
function initSync(module) {
|
|
2819
|
+
if (wasm !== undefined) return wasm;
|
|
2820
|
+
|
|
2821
|
+
|
|
2822
|
+
if (module !== undefined) {
|
|
2823
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
2824
|
+
({module} = module)
|
|
2825
|
+
} else {
|
|
2826
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2829
|
+
|
|
2830
|
+
const imports = __wbg_get_imports();
|
|
2831
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
2832
|
+
module = new WebAssembly.Module(module);
|
|
2833
|
+
}
|
|
2834
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
2835
|
+
return __wbg_finalize_init(instance, module);
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2838
|
+
async function __wbg_init(module_or_path) {
|
|
2839
|
+
if (wasm !== undefined) return wasm;
|
|
2840
|
+
|
|
2841
|
+
|
|
2842
|
+
if (module_or_path !== undefined) {
|
|
2843
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
2844
|
+
({module_or_path} = module_or_path)
|
|
2845
|
+
} else {
|
|
2846
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
|
|
2850
|
+
if (module_or_path === undefined) {
|
|
2851
|
+
module_or_path = new URL('nf_wasm_bg.wasm', import.meta.url);
|
|
2852
|
+
}
|
|
2853
|
+
const imports = __wbg_get_imports();
|
|
2854
|
+
|
|
2855
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
2856
|
+
module_or_path = fetch(module_or_path);
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
2860
|
+
|
|
2861
|
+
return __wbg_finalize_init(instance, module);
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2864
|
+
export { initSync, __wbg_init as default };
|