@viewscript/wasm 0.1.0-202605140639
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/package.json +16 -0
- package/vsc_wasm.d.ts +373 -0
- package/vsc_wasm.js +1725 -0
- package/vsc_wasm_bg.wasm +0 -0
package/vsc_wasm.js
ADDED
|
@@ -0,0 +1,1725 @@
|
|
|
1
|
+
/* @ts-self-types="./vsc_wasm.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WebGPU surface manager for browser environment.
|
|
5
|
+
*
|
|
6
|
+
* This struct manages the WebGPU surface lifecycle for browser rendering.
|
|
7
|
+
* It does NOT contain a `GpuRenderer` - rendering is delegated to `WebTarget`.
|
|
8
|
+
*
|
|
9
|
+
* ## Responsibilities
|
|
10
|
+
*
|
|
11
|
+
* - Surface creation and configuration
|
|
12
|
+
* - Surface texture acquisition (`surface_texture_view()`)
|
|
13
|
+
* - Resize handling
|
|
14
|
+
* - Device/queue sharing with `WebTarget`
|
|
15
|
+
*/
|
|
16
|
+
export class WasmGpuRenderer {
|
|
17
|
+
static __wrap(ptr) {
|
|
18
|
+
const obj = Object.create(WasmGpuRenderer.prototype);
|
|
19
|
+
obj.__wbg_ptr = ptr;
|
|
20
|
+
WasmGpuRendererFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
21
|
+
return obj;
|
|
22
|
+
}
|
|
23
|
+
__destroy_into_raw() {
|
|
24
|
+
const ptr = this.__wbg_ptr;
|
|
25
|
+
this.__wbg_ptr = 0;
|
|
26
|
+
WasmGpuRendererFinalization.unregister(this);
|
|
27
|
+
return ptr;
|
|
28
|
+
}
|
|
29
|
+
free() {
|
|
30
|
+
const ptr = this.__destroy_into_raw();
|
|
31
|
+
wasm.__wbg_wasmgpurenderer_free(ptr, 0);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Create a new WebGPU renderer bound to a canvas element.
|
|
35
|
+
*
|
|
36
|
+
* This is an async operation that:
|
|
37
|
+
* 1. Requests a GPU adapter from the browser
|
|
38
|
+
* 2. Requests a device and queue from the adapter
|
|
39
|
+
* 3. Creates a surface from the canvas element
|
|
40
|
+
* 4. Configures the surface for rendering
|
|
41
|
+
*
|
|
42
|
+
* # Arguments
|
|
43
|
+
*
|
|
44
|
+
* * `canvas` - The HTML canvas element to render to
|
|
45
|
+
*
|
|
46
|
+
* # Returns
|
|
47
|
+
*
|
|
48
|
+
* A `Promise` that resolves to `WasmGpuRenderer` or rejects with an error.
|
|
49
|
+
* @param {HTMLCanvasElement} canvas
|
|
50
|
+
* @returns {Promise<WasmGpuRenderer>}
|
|
51
|
+
*/
|
|
52
|
+
static create(canvas) {
|
|
53
|
+
const ret = wasm.wasmgpurenderer_create(addHeapObject(canvas));
|
|
54
|
+
return takeObject(ret);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get the current height in device pixels.
|
|
58
|
+
* @returns {number}
|
|
59
|
+
*/
|
|
60
|
+
get height() {
|
|
61
|
+
const ret = wasm.wasmgpurenderer_height(this.__wbg_ptr);
|
|
62
|
+
return ret >>> 0;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Resize the rendering surface.
|
|
66
|
+
*
|
|
67
|
+
* Call this when the canvas element is resized.
|
|
68
|
+
*
|
|
69
|
+
* # Arguments
|
|
70
|
+
*
|
|
71
|
+
* * `width` - New width in device pixels
|
|
72
|
+
* * `height` - New height in device pixels
|
|
73
|
+
* @param {number} width
|
|
74
|
+
* @param {number} height
|
|
75
|
+
*/
|
|
76
|
+
resize(width, height) {
|
|
77
|
+
try {
|
|
78
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
79
|
+
wasm.wasmgpurenderer_resize(retptr, this.__wbg_ptr, width, height);
|
|
80
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
81
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
82
|
+
if (r1) {
|
|
83
|
+
throw takeObject(r0);
|
|
84
|
+
}
|
|
85
|
+
} finally {
|
|
86
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Get the current width in device pixels.
|
|
91
|
+
* @returns {number}
|
|
92
|
+
*/
|
|
93
|
+
get width() {
|
|
94
|
+
const ret = wasm.wasmgpurenderer_width(this.__wbg_ptr);
|
|
95
|
+
return ret >>> 0;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (Symbol.dispose) WasmGpuRenderer.prototype[Symbol.dispose] = WasmGpuRenderer.prototype.free;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* ViewScript rendering engine for browser environment.
|
|
102
|
+
*
|
|
103
|
+
* This struct integrates the full rendering pipeline:
|
|
104
|
+
* - `ConstraintSolver`: Evaluates P-dimension constraints
|
|
105
|
+
* - `VsBuildInfo`: Event-sourcing ledger for constraint operations
|
|
106
|
+
* - `SceneBuilder`: Converts solver output to scene graph
|
|
107
|
+
* - `SceneConverter`: Converts scene graph to canvas nodes with topology rounding
|
|
108
|
+
* - `WasmGpuRenderer`: WebGPU-based rendering to canvas
|
|
109
|
+
*
|
|
110
|
+
* ## Architecture
|
|
111
|
+
*
|
|
112
|
+
* ```text
|
|
113
|
+
* TypeScript WASM Boundary Rust
|
|
114
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
115
|
+
* const engine = wasm-bindgen
|
|
116
|
+
* await WasmViewScriptEngine ─────────────► WasmViewScriptEngine::create()
|
|
117
|
+
* .create(canvas, dpr); │
|
|
118
|
+
* ▼
|
|
119
|
+
* engine.add_component(...) ─────────────► add_component() → VsBuildInfo
|
|
120
|
+
* │
|
|
121
|
+
* ▼
|
|
122
|
+
* engine.tick(mutations_json) ─────────────► tick()
|
|
123
|
+
* │
|
|
124
|
+
* ├─► Apply mutations (T-vector)
|
|
125
|
+
* ├─► ConstraintSolver.solve()
|
|
126
|
+
* ├─► SceneBuilder.build_scene()
|
|
127
|
+
* ├─► SceneConverter.convert_with_rounding()
|
|
128
|
+
* └─► WasmGpuRenderer.render_nodes()
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* ## Mutation Format (JSON)
|
|
132
|
+
*
|
|
133
|
+
* ```typescript
|
|
134
|
+
* // Translate: move component by delta
|
|
135
|
+
* engine.tick(JSON.stringify([
|
|
136
|
+
* { type: "Translate", entity_id: 1000, dx: 10, dy: 5 }
|
|
137
|
+
* ]));
|
|
138
|
+
*
|
|
139
|
+
* // SetPosition: move component to absolute position
|
|
140
|
+
* engine.tick(JSON.stringify([
|
|
141
|
+
* { type: "SetPosition", entity_id: 1000, x: 200, y: 150 }
|
|
142
|
+
* ]));
|
|
143
|
+
* ```
|
|
144
|
+
*
|
|
145
|
+
* ## Usage (TypeScript)
|
|
146
|
+
*
|
|
147
|
+
* ```typescript
|
|
148
|
+
* import init, { WasmViewScriptEngine } from 'vsc-wasm';
|
|
149
|
+
*
|
|
150
|
+
* await init();
|
|
151
|
+
*
|
|
152
|
+
* const canvas = document.getElementById('viewport') as HTMLCanvasElement;
|
|
153
|
+
* const engine = await WasmViewScriptEngine.create(canvas, window.devicePixelRatio);
|
|
154
|
+
*
|
|
155
|
+
* // Add a rounded rectangle component
|
|
156
|
+
* engine.add_component('RoundedRect', JSON.stringify({
|
|
157
|
+
* x: 100, y: 100, width: 200, height: 150, radius: 20, fill: '#ff0000'
|
|
158
|
+
* }));
|
|
159
|
+
*
|
|
160
|
+
* // Animation loop
|
|
161
|
+
* function animate() {
|
|
162
|
+
* engine.tick('[]'); // Empty mutations for static content
|
|
163
|
+
* requestAnimationFrame(animate);
|
|
164
|
+
* }
|
|
165
|
+
* animate();
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
export class WasmViewScriptEngine {
|
|
169
|
+
static __wrap(ptr) {
|
|
170
|
+
const obj = Object.create(WasmViewScriptEngine.prototype);
|
|
171
|
+
obj.__wbg_ptr = ptr;
|
|
172
|
+
WasmViewScriptEngineFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
173
|
+
return obj;
|
|
174
|
+
}
|
|
175
|
+
__destroy_into_raw() {
|
|
176
|
+
const ptr = this.__wbg_ptr;
|
|
177
|
+
this.__wbg_ptr = 0;
|
|
178
|
+
WasmViewScriptEngineFinalization.unregister(this);
|
|
179
|
+
return ptr;
|
|
180
|
+
}
|
|
181
|
+
free() {
|
|
182
|
+
const ptr = this.__destroy_into_raw();
|
|
183
|
+
wasm.__wbg_wasmviewscriptengine_free(ptr, 0);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Add a component to the scene.
|
|
187
|
+
*
|
|
188
|
+
* This method creates the necessary path entities and control points
|
|
189
|
+
* in the VsBuildInfo ledger based on the component type.
|
|
190
|
+
*
|
|
191
|
+
* # Arguments
|
|
192
|
+
*
|
|
193
|
+
* * `component_type` - Type of component: "RoundedRect", "Circle", "Path", etc.
|
|
194
|
+
* * `params_json` - JSON object with component parameters
|
|
195
|
+
*
|
|
196
|
+
* # Example JSON for RoundedRect
|
|
197
|
+
*
|
|
198
|
+
* ```json
|
|
199
|
+
* {
|
|
200
|
+
* "x": 100,
|
|
201
|
+
* "y": 100,
|
|
202
|
+
* "width": 200,
|
|
203
|
+
* "height": 150,
|
|
204
|
+
* "radius": 20,
|
|
205
|
+
* "fill": "#ff0000"
|
|
206
|
+
* }
|
|
207
|
+
* ```
|
|
208
|
+
*
|
|
209
|
+
* # Returns
|
|
210
|
+
*
|
|
211
|
+
* The entity ID of the created component.
|
|
212
|
+
* @param {string} component_type
|
|
213
|
+
* @param {string} params_json
|
|
214
|
+
* @returns {bigint}
|
|
215
|
+
*/
|
|
216
|
+
add_component(component_type, params_json) {
|
|
217
|
+
try {
|
|
218
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
219
|
+
const ptr0 = passStringToWasm0(component_type, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
220
|
+
const len0 = WASM_VECTOR_LEN;
|
|
221
|
+
const ptr1 = passStringToWasm0(params_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
222
|
+
const len1 = WASM_VECTOR_LEN;
|
|
223
|
+
wasm.wasmviewscriptengine_add_component(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
224
|
+
var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
|
|
225
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
226
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
227
|
+
if (r3) {
|
|
228
|
+
throw takeObject(r2);
|
|
229
|
+
}
|
|
230
|
+
return BigInt.asUintN(64, r0);
|
|
231
|
+
} finally {
|
|
232
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Create a new ViewScript engine bound to a canvas element.
|
|
237
|
+
*
|
|
238
|
+
* This is an async operation that initializes the WebGPU pipeline
|
|
239
|
+
* and sets up the constraint solver.
|
|
240
|
+
*
|
|
241
|
+
* # Arguments
|
|
242
|
+
*
|
|
243
|
+
* * `canvas` - The HTML canvas element to render to
|
|
244
|
+
* * `device_pixel_ratio` - DPR for coordinate scaling (e.g., 2.0 for Retina)
|
|
245
|
+
*
|
|
246
|
+
* # Returns
|
|
247
|
+
*
|
|
248
|
+
* A `Promise` that resolves to `WasmViewScriptEngine` or rejects with an error.
|
|
249
|
+
* @param {HTMLCanvasElement} canvas
|
|
250
|
+
* @param {number} device_pixel_ratio
|
|
251
|
+
* @returns {Promise<WasmViewScriptEngine>}
|
|
252
|
+
*/
|
|
253
|
+
static create(canvas, device_pixel_ratio) {
|
|
254
|
+
const ret = wasm.wasmviewscriptengine_create(addHeapObject(canvas), device_pixel_ratio);
|
|
255
|
+
return takeObject(ret);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Get the current canvas height in device pixels.
|
|
259
|
+
* @returns {number}
|
|
260
|
+
*/
|
|
261
|
+
get height() {
|
|
262
|
+
const ret = wasm.wasmviewscriptengine_height(this.__wbg_ptr);
|
|
263
|
+
return ret >>> 0;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Register a static image texture.
|
|
267
|
+
*
|
|
268
|
+
* The pixel data must be in RGBA8 format with length `width * height * 4`.
|
|
269
|
+
* Returns the assigned texture ID for use with `FillSpec::ExternalTexture`.
|
|
270
|
+
*
|
|
271
|
+
* # Arguments
|
|
272
|
+
*
|
|
273
|
+
* * `width` - Texture width in pixels
|
|
274
|
+
* * `height` - Texture height in pixels
|
|
275
|
+
* * `pixels` - RGBA8 pixel data
|
|
276
|
+
*
|
|
277
|
+
* # Returns
|
|
278
|
+
*
|
|
279
|
+
* A unique texture ID that can be used in `FillSpec::ExternalTexture.handle_name`
|
|
280
|
+
* as `"resource.texture.<id>"`.
|
|
281
|
+
* @param {number} width
|
|
282
|
+
* @param {number} height
|
|
283
|
+
* @param {Uint8Array} pixels
|
|
284
|
+
* @returns {bigint}
|
|
285
|
+
*/
|
|
286
|
+
register_image_texture(width, height, pixels) {
|
|
287
|
+
const ptr0 = passArray8ToWasm0(pixels, wasm.__wbindgen_export);
|
|
288
|
+
const len0 = WASM_VECTOR_LEN;
|
|
289
|
+
const ret = wasm.wasmviewscriptengine_register_image_texture(this.__wbg_ptr, width, height, ptr0, len0);
|
|
290
|
+
return BigInt.asUintN(64, ret);
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Register a video texture (requires per-frame updates).
|
|
294
|
+
*
|
|
295
|
+
* Unlike `register_image_texture`, this does not upload pixel data immediately.
|
|
296
|
+
* Call `update_texture_pixels()` each frame to update the video frame.
|
|
297
|
+
*
|
|
298
|
+
* # Arguments
|
|
299
|
+
*
|
|
300
|
+
* * `width` - Video frame width in pixels
|
|
301
|
+
* * `height` - Video frame height in pixels
|
|
302
|
+
*
|
|
303
|
+
* # Returns
|
|
304
|
+
*
|
|
305
|
+
* A unique texture ID for use with `update_texture_pixels()`.
|
|
306
|
+
* @param {number} width
|
|
307
|
+
* @param {number} height
|
|
308
|
+
* @returns {bigint}
|
|
309
|
+
*/
|
|
310
|
+
register_video_texture(width, height) {
|
|
311
|
+
const ret = wasm.wasmviewscriptengine_register_video_texture(this.__wbg_ptr, width, height);
|
|
312
|
+
return BigInt.asUintN(64, ret);
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Remove a texture from the registry.
|
|
316
|
+
*
|
|
317
|
+
* Frees the GPU resources associated with the texture.
|
|
318
|
+
*
|
|
319
|
+
* # Arguments
|
|
320
|
+
*
|
|
321
|
+
* * `texture_id` - ID returned by `register_*_texture()`
|
|
322
|
+
*
|
|
323
|
+
* # Returns
|
|
324
|
+
*
|
|
325
|
+
* `true` if the texture was found and removed, `false` otherwise.
|
|
326
|
+
* @param {bigint} texture_id
|
|
327
|
+
* @returns {boolean}
|
|
328
|
+
*/
|
|
329
|
+
remove_texture(texture_id) {
|
|
330
|
+
const ret = wasm.wasmviewscriptengine_remove_texture(this.__wbg_ptr, texture_id);
|
|
331
|
+
return ret !== 0;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Resize the rendering surface.
|
|
335
|
+
*
|
|
336
|
+
* # Arguments
|
|
337
|
+
*
|
|
338
|
+
* * `width` - New width in device pixels
|
|
339
|
+
* * `height` - New height in device pixels
|
|
340
|
+
* @param {number} width
|
|
341
|
+
* @param {number} height
|
|
342
|
+
*/
|
|
343
|
+
resize(width, height) {
|
|
344
|
+
try {
|
|
345
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
346
|
+
wasm.wasmviewscriptengine_resize(retptr, this.__wbg_ptr, width, height);
|
|
347
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
348
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
349
|
+
if (r1) {
|
|
350
|
+
throw takeObject(r0);
|
|
351
|
+
}
|
|
352
|
+
} finally {
|
|
353
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Set a component's fill to an external texture.
|
|
358
|
+
*
|
|
359
|
+
* This modifies the `PathEntityEntry` in `build_info.path_entities` to use
|
|
360
|
+
* `FillSpec::ExternalTexture` with the specified texture ID.
|
|
361
|
+
*
|
|
362
|
+
* # Arguments
|
|
363
|
+
*
|
|
364
|
+
* * `component_entity_id` - Entity ID of the component (path) to modify
|
|
365
|
+
* * `texture_id` - Texture ID returned by `register_image_texture()`
|
|
366
|
+
*
|
|
367
|
+
* # Returns
|
|
368
|
+
*
|
|
369
|
+
* `Ok(())` if the component was found and updated, `Err` otherwise.
|
|
370
|
+
* @param {bigint} component_entity_id
|
|
371
|
+
* @param {bigint} texture_id
|
|
372
|
+
*/
|
|
373
|
+
set_component_fill_texture(component_entity_id, texture_id) {
|
|
374
|
+
try {
|
|
375
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
376
|
+
wasm.wasmviewscriptengine_set_component_fill_texture(retptr, this.__wbg_ptr, component_entity_id, texture_id);
|
|
377
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
378
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
379
|
+
if (r1) {
|
|
380
|
+
throw takeObject(r0);
|
|
381
|
+
}
|
|
382
|
+
} finally {
|
|
383
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Get the number of registered textures.
|
|
388
|
+
* @returns {number}
|
|
389
|
+
*/
|
|
390
|
+
texture_count() {
|
|
391
|
+
const ret = wasm.wasmviewscriptengine_texture_count(this.__wbg_ptr);
|
|
392
|
+
return ret >>> 0;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Execute one frame of the rendering pipeline.
|
|
396
|
+
*
|
|
397
|
+
* This method implements the Q→T→P pipeline with derived variable evaluation:
|
|
398
|
+
* 1. Phase 1: Inject Q-dimension values or apply legacy mutations
|
|
399
|
+
* 2. Phase 2: solve → derive → re-solve loop (max 2 iterations)
|
|
400
|
+
* - Run constraint solver
|
|
401
|
+
* - Build scene graph
|
|
402
|
+
* - Evaluate derived Q-variables (e.g., hover detection)
|
|
403
|
+
* - If derived values changed, re-inject and loop
|
|
404
|
+
* 3. Render the final scene
|
|
405
|
+
*
|
|
406
|
+
* # Arguments
|
|
407
|
+
*
|
|
408
|
+
* * `input_json` - Either:
|
|
409
|
+
* - New format: `{"values": {"input.pointer.x": {"type": "Float", "value": 100}}}`
|
|
410
|
+
* - Legacy format: `[{"type": "Translate", "entity_id": 1, "dx": 10, "dy": 5}]`
|
|
411
|
+
*
|
|
412
|
+
* # Returns
|
|
413
|
+
*
|
|
414
|
+
* `Ok(())` on success, or a JavaScript error on failure.
|
|
415
|
+
* @param {string} input_json
|
|
416
|
+
*/
|
|
417
|
+
tick(input_json) {
|
|
418
|
+
try {
|
|
419
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
420
|
+
const ptr0 = passStringToWasm0(input_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
421
|
+
const len0 = WASM_VECTOR_LEN;
|
|
422
|
+
wasm.wasmviewscriptengine_tick(retptr, this.__wbg_ptr, ptr0, len0);
|
|
423
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
424
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
425
|
+
if (r1) {
|
|
426
|
+
throw takeObject(r0);
|
|
427
|
+
}
|
|
428
|
+
} finally {
|
|
429
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Update texture pixel data.
|
|
434
|
+
*
|
|
435
|
+
* Use this for video textures (every frame) or animated images (on frame change).
|
|
436
|
+
* The pixel data must be RGBA8 format with length `width * height * 4`.
|
|
437
|
+
*
|
|
438
|
+
* # Arguments
|
|
439
|
+
*
|
|
440
|
+
* * `texture_id` - ID returned by `register_*_texture()`
|
|
441
|
+
* * `pixels` - RGBA8 pixel data
|
|
442
|
+
*
|
|
443
|
+
* # Returns
|
|
444
|
+
*
|
|
445
|
+
* `true` if the texture was found and updated, `false` otherwise.
|
|
446
|
+
* @param {bigint} texture_id
|
|
447
|
+
* @param {Uint8Array} pixels
|
|
448
|
+
* @returns {boolean}
|
|
449
|
+
*/
|
|
450
|
+
update_texture_pixels(texture_id, pixels) {
|
|
451
|
+
const ptr0 = passArray8ToWasm0(pixels, wasm.__wbindgen_export);
|
|
452
|
+
const len0 = WASM_VECTOR_LEN;
|
|
453
|
+
const ret = wasm.wasmviewscriptengine_update_texture_pixels(this.__wbg_ptr, texture_id, ptr0, len0);
|
|
454
|
+
return ret !== 0;
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Get the current canvas width in device pixels.
|
|
458
|
+
* @returns {number}
|
|
459
|
+
*/
|
|
460
|
+
get width() {
|
|
461
|
+
const ret = wasm.wasmviewscriptengine_width(this.__wbg_ptr);
|
|
462
|
+
return ret >>> 0;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
if (Symbol.dispose) WasmViewScriptEngine.prototype[Symbol.dispose] = WasmViewScriptEngine.prototype.free;
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Get WebGPU adapter info as a JSON string.
|
|
469
|
+
*
|
|
470
|
+
* Returns information about the GPU adapter, or an error if WebGPU is not available.
|
|
471
|
+
* @returns {Promise<string>}
|
|
472
|
+
*/
|
|
473
|
+
export function get_adapter_info() {
|
|
474
|
+
const ret = wasm.get_adapter_info();
|
|
475
|
+
return takeObject(ret);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Check if WebGPU is available in the current browser.
|
|
480
|
+
*
|
|
481
|
+
* Returns `true` if `navigator.gpu` exists and is not undefined.
|
|
482
|
+
* @returns {boolean}
|
|
483
|
+
*/
|
|
484
|
+
export function is_webgpu_available() {
|
|
485
|
+
const ret = wasm.is_webgpu_available();
|
|
486
|
+
return ret !== 0;
|
|
487
|
+
}
|
|
488
|
+
function __wbg_get_imports() {
|
|
489
|
+
const import0 = {
|
|
490
|
+
__proto__: null,
|
|
491
|
+
__wbg_Window_b0c275b50676d397: function(arg0) {
|
|
492
|
+
const ret = getObject(arg0).Window;
|
|
493
|
+
return addHeapObject(ret);
|
|
494
|
+
},
|
|
495
|
+
__wbg_WorkerGlobalScope_7a1f78d9f7542cfa: function(arg0) {
|
|
496
|
+
const ret = getObject(arg0).WorkerGlobalScope;
|
|
497
|
+
return addHeapObject(ret);
|
|
498
|
+
},
|
|
499
|
+
__wbg___wbindgen_debug_string_edece8177ad01481: function(arg0, arg1) {
|
|
500
|
+
const ret = debugString(getObject(arg1));
|
|
501
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
502
|
+
const len1 = WASM_VECTOR_LEN;
|
|
503
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
504
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
505
|
+
},
|
|
506
|
+
__wbg___wbindgen_is_function_5cd60d5cf78b4eef: function(arg0) {
|
|
507
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
508
|
+
return ret;
|
|
509
|
+
},
|
|
510
|
+
__wbg___wbindgen_is_null_2042690d351e14f0: function(arg0) {
|
|
511
|
+
const ret = getObject(arg0) === null;
|
|
512
|
+
return ret;
|
|
513
|
+
},
|
|
514
|
+
__wbg___wbindgen_is_object_b4593df85baada48: function(arg0) {
|
|
515
|
+
const val = getObject(arg0);
|
|
516
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
517
|
+
return ret;
|
|
518
|
+
},
|
|
519
|
+
__wbg___wbindgen_is_undefined_35bb9f4c7fd651d5: function(arg0) {
|
|
520
|
+
const ret = getObject(arg0) === undefined;
|
|
521
|
+
return ret;
|
|
522
|
+
},
|
|
523
|
+
__wbg___wbindgen_string_get_d109740c0d18f4d7: function(arg0, arg1) {
|
|
524
|
+
const obj = getObject(arg1);
|
|
525
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
526
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
527
|
+
var len1 = WASM_VECTOR_LEN;
|
|
528
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
529
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
530
|
+
},
|
|
531
|
+
__wbg___wbindgen_throw_9c31b086c2b26051: function(arg0, arg1) {
|
|
532
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
533
|
+
},
|
|
534
|
+
__wbg__wbg_cb_unref_3fa391f3fcdb55f8: function(arg0) {
|
|
535
|
+
getObject(arg0)._wbg_cb_unref();
|
|
536
|
+
},
|
|
537
|
+
__wbg_beginComputePass_0fb772608bf84f44: function(arg0, arg1) {
|
|
538
|
+
const ret = getObject(arg0).beginComputePass(getObject(arg1));
|
|
539
|
+
return addHeapObject(ret);
|
|
540
|
+
},
|
|
541
|
+
__wbg_beginRenderPass_c662486e5caabb09: function(arg0, arg1) {
|
|
542
|
+
const ret = getObject(arg0).beginRenderPass(getObject(arg1));
|
|
543
|
+
return addHeapObject(ret);
|
|
544
|
+
},
|
|
545
|
+
__wbg_buffer_8d6798e32d1afd34: function(arg0) {
|
|
546
|
+
const ret = getObject(arg0).buffer;
|
|
547
|
+
return addHeapObject(ret);
|
|
548
|
+
},
|
|
549
|
+
__wbg_call_dfde26266607c996: function() { return handleError(function (arg0, arg1, arg2) {
|
|
550
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
551
|
+
return addHeapObject(ret);
|
|
552
|
+
}, arguments); },
|
|
553
|
+
__wbg_clearBuffer_e063e34f4a181e05: function(arg0, arg1, arg2, arg3) {
|
|
554
|
+
getObject(arg0).clearBuffer(getObject(arg1), arg2, arg3);
|
|
555
|
+
},
|
|
556
|
+
__wbg_clearBuffer_f330030ddc7767fc: function(arg0, arg1, arg2) {
|
|
557
|
+
getObject(arg0).clearBuffer(getObject(arg1), arg2);
|
|
558
|
+
},
|
|
559
|
+
__wbg_configure_c71c9f57ca3edf98: function(arg0, arg1) {
|
|
560
|
+
getObject(arg0).configure(getObject(arg1));
|
|
561
|
+
},
|
|
562
|
+
__wbg_copyBufferToBuffer_910ae8c201bdff01: function(arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
563
|
+
getObject(arg0).copyBufferToBuffer(getObject(arg1), arg2, getObject(arg3), arg4, arg5);
|
|
564
|
+
},
|
|
565
|
+
__wbg_copyBufferToTexture_8c287708aff282a4: function(arg0, arg1, arg2, arg3) {
|
|
566
|
+
getObject(arg0).copyBufferToTexture(getObject(arg1), getObject(arg2), getObject(arg3));
|
|
567
|
+
},
|
|
568
|
+
__wbg_copyExternalImageToTexture_540fcadea7d8323f: function(arg0, arg1, arg2, arg3) {
|
|
569
|
+
getObject(arg0).copyExternalImageToTexture(getObject(arg1), getObject(arg2), getObject(arg3));
|
|
570
|
+
},
|
|
571
|
+
__wbg_copyTextureToBuffer_76965133f36672a4: function(arg0, arg1, arg2, arg3) {
|
|
572
|
+
getObject(arg0).copyTextureToBuffer(getObject(arg1), getObject(arg2), getObject(arg3));
|
|
573
|
+
},
|
|
574
|
+
__wbg_copyTextureToTexture_04331d5254bea8fc: function(arg0, arg1, arg2, arg3) {
|
|
575
|
+
getObject(arg0).copyTextureToTexture(getObject(arg1), getObject(arg2), getObject(arg3));
|
|
576
|
+
},
|
|
577
|
+
__wbg_createBindGroupLayout_fe258aa231f602a1: function(arg0, arg1) {
|
|
578
|
+
const ret = getObject(arg0).createBindGroupLayout(getObject(arg1));
|
|
579
|
+
return addHeapObject(ret);
|
|
580
|
+
},
|
|
581
|
+
__wbg_createBindGroup_783178b92eca4f94: function(arg0, arg1) {
|
|
582
|
+
const ret = getObject(arg0).createBindGroup(getObject(arg1));
|
|
583
|
+
return addHeapObject(ret);
|
|
584
|
+
},
|
|
585
|
+
__wbg_createBuffer_05c143bc69af7de1: function(arg0, arg1) {
|
|
586
|
+
const ret = getObject(arg0).createBuffer(getObject(arg1));
|
|
587
|
+
return addHeapObject(ret);
|
|
588
|
+
},
|
|
589
|
+
__wbg_createCommandEncoder_eeac00d01e7c7215: function(arg0, arg1) {
|
|
590
|
+
const ret = getObject(arg0).createCommandEncoder(getObject(arg1));
|
|
591
|
+
return addHeapObject(ret);
|
|
592
|
+
},
|
|
593
|
+
__wbg_createComputePipeline_70cb69a35311bb5a: function(arg0, arg1) {
|
|
594
|
+
const ret = getObject(arg0).createComputePipeline(getObject(arg1));
|
|
595
|
+
return addHeapObject(ret);
|
|
596
|
+
},
|
|
597
|
+
__wbg_createPipelineLayout_3195019c488e9d1f: function(arg0, arg1) {
|
|
598
|
+
const ret = getObject(arg0).createPipelineLayout(getObject(arg1));
|
|
599
|
+
return addHeapObject(ret);
|
|
600
|
+
},
|
|
601
|
+
__wbg_createQuerySet_a8afd88335f1ae22: function(arg0, arg1) {
|
|
602
|
+
const ret = getObject(arg0).createQuerySet(getObject(arg1));
|
|
603
|
+
return addHeapObject(ret);
|
|
604
|
+
},
|
|
605
|
+
__wbg_createRenderBundleEncoder_0ae4be9a26b4f4aa: function(arg0, arg1) {
|
|
606
|
+
const ret = getObject(arg0).createRenderBundleEncoder(getObject(arg1));
|
|
607
|
+
return addHeapObject(ret);
|
|
608
|
+
},
|
|
609
|
+
__wbg_createRenderPipeline_430c946fe289280f: function(arg0, arg1) {
|
|
610
|
+
const ret = getObject(arg0).createRenderPipeline(getObject(arg1));
|
|
611
|
+
return addHeapObject(ret);
|
|
612
|
+
},
|
|
613
|
+
__wbg_createSampler_59ee59f9ce9c89e6: function(arg0, arg1) {
|
|
614
|
+
const ret = getObject(arg0).createSampler(getObject(arg1));
|
|
615
|
+
return addHeapObject(ret);
|
|
616
|
+
},
|
|
617
|
+
__wbg_createShaderModule_cb92dd515bc68e5a: function(arg0, arg1) {
|
|
618
|
+
const ret = getObject(arg0).createShaderModule(getObject(arg1));
|
|
619
|
+
return addHeapObject(ret);
|
|
620
|
+
},
|
|
621
|
+
__wbg_createTexture_ae83ede28133180f: function(arg0, arg1) {
|
|
622
|
+
const ret = getObject(arg0).createTexture(getObject(arg1));
|
|
623
|
+
return addHeapObject(ret);
|
|
624
|
+
},
|
|
625
|
+
__wbg_createView_c0fb516125a12571: function(arg0, arg1) {
|
|
626
|
+
const ret = getObject(arg0).createView(getObject(arg1));
|
|
627
|
+
return addHeapObject(ret);
|
|
628
|
+
},
|
|
629
|
+
__wbg_destroy_d1537bee2b5a7849: function(arg0) {
|
|
630
|
+
getObject(arg0).destroy();
|
|
631
|
+
},
|
|
632
|
+
__wbg_destroy_d28e196e9dbc3b27: function(arg0) {
|
|
633
|
+
getObject(arg0).destroy();
|
|
634
|
+
},
|
|
635
|
+
__wbg_destroy_ddd5bee0b4b02f49: function(arg0) {
|
|
636
|
+
getObject(arg0).destroy();
|
|
637
|
+
},
|
|
638
|
+
__wbg_dispatchWorkgroupsIndirect_e915df9199133ac5: function(arg0, arg1, arg2) {
|
|
639
|
+
getObject(arg0).dispatchWorkgroupsIndirect(getObject(arg1), arg2);
|
|
640
|
+
},
|
|
641
|
+
__wbg_dispatchWorkgroups_0d71a3ed9fcaee9f: function(arg0, arg1, arg2, arg3) {
|
|
642
|
+
getObject(arg0).dispatchWorkgroups(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0);
|
|
643
|
+
},
|
|
644
|
+
__wbg_document_3540635616a18455: function(arg0) {
|
|
645
|
+
const ret = getObject(arg0).document;
|
|
646
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
647
|
+
},
|
|
648
|
+
__wbg_drawIndexedIndirect_0954a720a9b13248: function(arg0, arg1, arg2) {
|
|
649
|
+
getObject(arg0).drawIndexedIndirect(getObject(arg1), arg2);
|
|
650
|
+
},
|
|
651
|
+
__wbg_drawIndexedIndirect_7882fca885de47ce: function(arg0, arg1, arg2) {
|
|
652
|
+
getObject(arg0).drawIndexedIndirect(getObject(arg1), arg2);
|
|
653
|
+
},
|
|
654
|
+
__wbg_drawIndexed_280977bb1d3baf3d: function(arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
655
|
+
getObject(arg0).drawIndexed(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4, arg5 >>> 0);
|
|
656
|
+
},
|
|
657
|
+
__wbg_drawIndexed_9a150a51a8427045: function(arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
658
|
+
getObject(arg0).drawIndexed(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4, arg5 >>> 0);
|
|
659
|
+
},
|
|
660
|
+
__wbg_drawIndirect_b393626eb70ae7fb: function(arg0, arg1, arg2) {
|
|
661
|
+
getObject(arg0).drawIndirect(getObject(arg1), arg2);
|
|
662
|
+
},
|
|
663
|
+
__wbg_drawIndirect_c6c299eb2ddf8fd7: function(arg0, arg1, arg2) {
|
|
664
|
+
getObject(arg0).drawIndirect(getObject(arg1), arg2);
|
|
665
|
+
},
|
|
666
|
+
__wbg_draw_26370233bc7d2e7e: function(arg0, arg1, arg2, arg3, arg4) {
|
|
667
|
+
getObject(arg0).draw(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0);
|
|
668
|
+
},
|
|
669
|
+
__wbg_draw_83285c3877561ec1: function(arg0, arg1, arg2, arg3, arg4) {
|
|
670
|
+
getObject(arg0).draw(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0);
|
|
671
|
+
},
|
|
672
|
+
__wbg_end_420d93a37f764933: function(arg0) {
|
|
673
|
+
getObject(arg0).end();
|
|
674
|
+
},
|
|
675
|
+
__wbg_end_97a4259681c42d8d: function(arg0) {
|
|
676
|
+
getObject(arg0).end();
|
|
677
|
+
},
|
|
678
|
+
__wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
|
|
679
|
+
let deferred0_0;
|
|
680
|
+
let deferred0_1;
|
|
681
|
+
try {
|
|
682
|
+
deferred0_0 = arg0;
|
|
683
|
+
deferred0_1 = arg1;
|
|
684
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
685
|
+
} finally {
|
|
686
|
+
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
687
|
+
}
|
|
688
|
+
},
|
|
689
|
+
__wbg_error_d9a855c84f9b4e4c: function(arg0) {
|
|
690
|
+
const ret = getObject(arg0).error;
|
|
691
|
+
return addHeapObject(ret);
|
|
692
|
+
},
|
|
693
|
+
__wbg_executeBundles_452872ac4afbbf92: function(arg0, arg1) {
|
|
694
|
+
getObject(arg0).executeBundles(getObject(arg1));
|
|
695
|
+
},
|
|
696
|
+
__wbg_features_15adc13e5b141301: function(arg0) {
|
|
697
|
+
const ret = getObject(arg0).features;
|
|
698
|
+
return addHeapObject(ret);
|
|
699
|
+
},
|
|
700
|
+
__wbg_features_f6c1f470639a88e2: function(arg0) {
|
|
701
|
+
const ret = getObject(arg0).features;
|
|
702
|
+
return addHeapObject(ret);
|
|
703
|
+
},
|
|
704
|
+
__wbg_finish_23cbd862d4229ec3: function(arg0, arg1) {
|
|
705
|
+
const ret = getObject(arg0).finish(getObject(arg1));
|
|
706
|
+
return addHeapObject(ret);
|
|
707
|
+
},
|
|
708
|
+
__wbg_finish_52172eac54898d16: function(arg0) {
|
|
709
|
+
const ret = getObject(arg0).finish();
|
|
710
|
+
return addHeapObject(ret);
|
|
711
|
+
},
|
|
712
|
+
__wbg_finish_94bc184b535e2a90: function(arg0, arg1) {
|
|
713
|
+
const ret = getObject(arg0).finish(getObject(arg1));
|
|
714
|
+
return addHeapObject(ret);
|
|
715
|
+
},
|
|
716
|
+
__wbg_finish_dad34d81d4500e85: function(arg0) {
|
|
717
|
+
const ret = getObject(arg0).finish();
|
|
718
|
+
return addHeapObject(ret);
|
|
719
|
+
},
|
|
720
|
+
__wbg_getBindGroupLayout_6d503a1fba524ee6: function(arg0, arg1) {
|
|
721
|
+
const ret = getObject(arg0).getBindGroupLayout(arg1 >>> 0);
|
|
722
|
+
return addHeapObject(ret);
|
|
723
|
+
},
|
|
724
|
+
__wbg_getBindGroupLayout_bc897888c0670dbe: function(arg0, arg1) {
|
|
725
|
+
const ret = getObject(arg0).getBindGroupLayout(arg1 >>> 0);
|
|
726
|
+
return addHeapObject(ret);
|
|
727
|
+
},
|
|
728
|
+
__wbg_getCompilationInfo_469a33f449854be7: function(arg0) {
|
|
729
|
+
const ret = getObject(arg0).getCompilationInfo();
|
|
730
|
+
return addHeapObject(ret);
|
|
731
|
+
},
|
|
732
|
+
__wbg_getContext_47ea64e14d931e3e: function() { return handleError(function (arg0, arg1, arg2) {
|
|
733
|
+
const ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2));
|
|
734
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
735
|
+
}, arguments); },
|
|
736
|
+
__wbg_getContext_e1463ff7aa682d57: function() { return handleError(function (arg0, arg1, arg2) {
|
|
737
|
+
const ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2));
|
|
738
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
739
|
+
}, arguments); },
|
|
740
|
+
__wbg_getCurrentTexture_e27b103ea7a3ce3c: function(arg0) {
|
|
741
|
+
const ret = getObject(arg0).getCurrentTexture();
|
|
742
|
+
return addHeapObject(ret);
|
|
743
|
+
},
|
|
744
|
+
__wbg_getMappedRange_4f36f39e059a63c6: function(arg0, arg1, arg2) {
|
|
745
|
+
const ret = getObject(arg0).getMappedRange(arg1, arg2);
|
|
746
|
+
return addHeapObject(ret);
|
|
747
|
+
},
|
|
748
|
+
__wbg_getPreferredCanvasFormat_13332df72e63723a: function(arg0) {
|
|
749
|
+
const ret = getObject(arg0).getPreferredCanvasFormat();
|
|
750
|
+
return (__wbindgen_enum_GpuTextureFormat.indexOf(ret) + 1 || 96) - 1;
|
|
751
|
+
},
|
|
752
|
+
__wbg_get_3c19db9bed86ee3b: function(arg0, arg1) {
|
|
753
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
754
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
755
|
+
},
|
|
756
|
+
__wbg_get_98fdf51d029a75eb: function(arg0, arg1) {
|
|
757
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
758
|
+
return addHeapObject(ret);
|
|
759
|
+
},
|
|
760
|
+
__wbg_get_dcf82ab8aad1a593: function() { return handleError(function (arg0, arg1) {
|
|
761
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
762
|
+
return addHeapObject(ret);
|
|
763
|
+
}, arguments); },
|
|
764
|
+
__wbg_gpu_c773d7932dc745d7: function(arg0) {
|
|
765
|
+
const ret = getObject(arg0).gpu;
|
|
766
|
+
return addHeapObject(ret);
|
|
767
|
+
},
|
|
768
|
+
__wbg_has_b54bd7b6e9da11c7: function(arg0, arg1, arg2) {
|
|
769
|
+
const ret = getObject(arg0).has(getStringFromWasm0(arg1, arg2));
|
|
770
|
+
return ret;
|
|
771
|
+
},
|
|
772
|
+
__wbg_height_aef2a2eb10d0d530: function(arg0) {
|
|
773
|
+
const ret = getObject(arg0).height;
|
|
774
|
+
return ret;
|
|
775
|
+
},
|
|
776
|
+
__wbg_instanceof_GpuAdapter_0731153d2b08720b: function(arg0) {
|
|
777
|
+
let result;
|
|
778
|
+
try {
|
|
779
|
+
result = getObject(arg0) instanceof GPUAdapter;
|
|
780
|
+
} catch (_) {
|
|
781
|
+
result = false;
|
|
782
|
+
}
|
|
783
|
+
const ret = result;
|
|
784
|
+
return ret;
|
|
785
|
+
},
|
|
786
|
+
__wbg_instanceof_GpuCanvasContext_d14121c7bd72fcef: function(arg0) {
|
|
787
|
+
let result;
|
|
788
|
+
try {
|
|
789
|
+
result = getObject(arg0) instanceof GPUCanvasContext;
|
|
790
|
+
} catch (_) {
|
|
791
|
+
result = false;
|
|
792
|
+
}
|
|
793
|
+
const ret = result;
|
|
794
|
+
return ret;
|
|
795
|
+
},
|
|
796
|
+
__wbg_instanceof_GpuDeviceLostInfo_a3677ebb8241d800: function(arg0) {
|
|
797
|
+
let result;
|
|
798
|
+
try {
|
|
799
|
+
result = getObject(arg0) instanceof GPUDeviceLostInfo;
|
|
800
|
+
} catch (_) {
|
|
801
|
+
result = false;
|
|
802
|
+
}
|
|
803
|
+
const ret = result;
|
|
804
|
+
return ret;
|
|
805
|
+
},
|
|
806
|
+
__wbg_instanceof_GpuOutOfMemoryError_391d9a08edbfa04b: function(arg0) {
|
|
807
|
+
let result;
|
|
808
|
+
try {
|
|
809
|
+
result = getObject(arg0) instanceof GPUOutOfMemoryError;
|
|
810
|
+
} catch (_) {
|
|
811
|
+
result = false;
|
|
812
|
+
}
|
|
813
|
+
const ret = result;
|
|
814
|
+
return ret;
|
|
815
|
+
},
|
|
816
|
+
__wbg_instanceof_GpuValidationError_f4d803c383da3c92: function(arg0) {
|
|
817
|
+
let result;
|
|
818
|
+
try {
|
|
819
|
+
result = getObject(arg0) instanceof GPUValidationError;
|
|
820
|
+
} catch (_) {
|
|
821
|
+
result = false;
|
|
822
|
+
}
|
|
823
|
+
const ret = result;
|
|
824
|
+
return ret;
|
|
825
|
+
},
|
|
826
|
+
__wbg_instanceof_Object_03924e0dbda74bd8: function(arg0) {
|
|
827
|
+
let result;
|
|
828
|
+
try {
|
|
829
|
+
result = getObject(arg0) instanceof Object;
|
|
830
|
+
} catch (_) {
|
|
831
|
+
result = false;
|
|
832
|
+
}
|
|
833
|
+
const ret = result;
|
|
834
|
+
return ret;
|
|
835
|
+
},
|
|
836
|
+
__wbg_instanceof_Window_faa5cf994f49cca7: function(arg0) {
|
|
837
|
+
let result;
|
|
838
|
+
try {
|
|
839
|
+
result = getObject(arg0) instanceof Window;
|
|
840
|
+
} catch (_) {
|
|
841
|
+
result = false;
|
|
842
|
+
}
|
|
843
|
+
const ret = result;
|
|
844
|
+
return ret;
|
|
845
|
+
},
|
|
846
|
+
__wbg_label_614ef5e608843844: function(arg0, arg1) {
|
|
847
|
+
const ret = getObject(arg1).label;
|
|
848
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
849
|
+
const len1 = WASM_VECTOR_LEN;
|
|
850
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
851
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
852
|
+
},
|
|
853
|
+
__wbg_length_2591a0f4f659a55c: function(arg0) {
|
|
854
|
+
const ret = getObject(arg0).length;
|
|
855
|
+
return ret;
|
|
856
|
+
},
|
|
857
|
+
__wbg_length_56fcd3e2b7e0299d: function(arg0) {
|
|
858
|
+
const ret = getObject(arg0).length;
|
|
859
|
+
return ret;
|
|
860
|
+
},
|
|
861
|
+
__wbg_length_d34bf7d191aa0640: function(arg0) {
|
|
862
|
+
const ret = getObject(arg0).length;
|
|
863
|
+
return ret;
|
|
864
|
+
},
|
|
865
|
+
__wbg_limits_2bfe39eb5f0b5a01: function(arg0) {
|
|
866
|
+
const ret = getObject(arg0).limits;
|
|
867
|
+
return addHeapObject(ret);
|
|
868
|
+
},
|
|
869
|
+
__wbg_limits_77193ad8b62f8502: function(arg0) {
|
|
870
|
+
const ret = getObject(arg0).limits;
|
|
871
|
+
return addHeapObject(ret);
|
|
872
|
+
},
|
|
873
|
+
__wbg_lineNum_95b780ade9fb4ba3: function(arg0) {
|
|
874
|
+
const ret = getObject(arg0).lineNum;
|
|
875
|
+
return ret;
|
|
876
|
+
},
|
|
877
|
+
__wbg_log_eb752234eec406d1: function(arg0) {
|
|
878
|
+
console.log(getObject(arg0));
|
|
879
|
+
},
|
|
880
|
+
__wbg_lost_21e9db8a9502a0ca: function(arg0) {
|
|
881
|
+
const ret = getObject(arg0).lost;
|
|
882
|
+
return addHeapObject(ret);
|
|
883
|
+
},
|
|
884
|
+
__wbg_mapAsync_f4fc38ac51855b15: function(arg0, arg1, arg2, arg3) {
|
|
885
|
+
const ret = getObject(arg0).mapAsync(arg1 >>> 0, arg2, arg3);
|
|
886
|
+
return addHeapObject(ret);
|
|
887
|
+
},
|
|
888
|
+
__wbg_maxBindGroups_cc0c1b6031ac310e: function(arg0) {
|
|
889
|
+
const ret = getObject(arg0).maxBindGroups;
|
|
890
|
+
return ret;
|
|
891
|
+
},
|
|
892
|
+
__wbg_maxBindingsPerBindGroup_d950de0c90e382e0: function(arg0) {
|
|
893
|
+
const ret = getObject(arg0).maxBindingsPerBindGroup;
|
|
894
|
+
return ret;
|
|
895
|
+
},
|
|
896
|
+
__wbg_maxBufferSize_01e5e024c304478a: function(arg0) {
|
|
897
|
+
const ret = getObject(arg0).maxBufferSize;
|
|
898
|
+
return ret;
|
|
899
|
+
},
|
|
900
|
+
__wbg_maxColorAttachmentBytesPerSample_91fc5eb9155186fd: function(arg0) {
|
|
901
|
+
const ret = getObject(arg0).maxColorAttachmentBytesPerSample;
|
|
902
|
+
return ret;
|
|
903
|
+
},
|
|
904
|
+
__wbg_maxColorAttachments_69f3bac8513cd2ce: function(arg0) {
|
|
905
|
+
const ret = getObject(arg0).maxColorAttachments;
|
|
906
|
+
return ret;
|
|
907
|
+
},
|
|
908
|
+
__wbg_maxComputeInvocationsPerWorkgroup_5d8e1f9e65b5443c: function(arg0) {
|
|
909
|
+
const ret = getObject(arg0).maxComputeInvocationsPerWorkgroup;
|
|
910
|
+
return ret;
|
|
911
|
+
},
|
|
912
|
+
__wbg_maxComputeWorkgroupSizeX_e8c75fa90e0b00b7: function(arg0) {
|
|
913
|
+
const ret = getObject(arg0).maxComputeWorkgroupSizeX;
|
|
914
|
+
return ret;
|
|
915
|
+
},
|
|
916
|
+
__wbg_maxComputeWorkgroupSizeY_72bce71ec7fa9330: function(arg0) {
|
|
917
|
+
const ret = getObject(arg0).maxComputeWorkgroupSizeY;
|
|
918
|
+
return ret;
|
|
919
|
+
},
|
|
920
|
+
__wbg_maxComputeWorkgroupSizeZ_8c7050ac47c80e42: function(arg0) {
|
|
921
|
+
const ret = getObject(arg0).maxComputeWorkgroupSizeZ;
|
|
922
|
+
return ret;
|
|
923
|
+
},
|
|
924
|
+
__wbg_maxComputeWorkgroupStorageSize_b789a39c5a0fd04a: function(arg0) {
|
|
925
|
+
const ret = getObject(arg0).maxComputeWorkgroupStorageSize;
|
|
926
|
+
return ret;
|
|
927
|
+
},
|
|
928
|
+
__wbg_maxComputeWorkgroupsPerDimension_a02a7f66f7c68b9c: function(arg0) {
|
|
929
|
+
const ret = getObject(arg0).maxComputeWorkgroupsPerDimension;
|
|
930
|
+
return ret;
|
|
931
|
+
},
|
|
932
|
+
__wbg_maxDynamicStorageBuffersPerPipelineLayout_90d4eb33665de8d1: function(arg0) {
|
|
933
|
+
const ret = getObject(arg0).maxDynamicStorageBuffersPerPipelineLayout;
|
|
934
|
+
return ret;
|
|
935
|
+
},
|
|
936
|
+
__wbg_maxDynamicUniformBuffersPerPipelineLayout_835864d8a793cc95: function(arg0) {
|
|
937
|
+
const ret = getObject(arg0).maxDynamicUniformBuffersPerPipelineLayout;
|
|
938
|
+
return ret;
|
|
939
|
+
},
|
|
940
|
+
__wbg_maxSampledTexturesPerShaderStage_f1fdaca8bd10047f: function(arg0) {
|
|
941
|
+
const ret = getObject(arg0).maxSampledTexturesPerShaderStage;
|
|
942
|
+
return ret;
|
|
943
|
+
},
|
|
944
|
+
__wbg_maxSamplersPerShaderStage_a0126ce660fc903a: function(arg0) {
|
|
945
|
+
const ret = getObject(arg0).maxSamplersPerShaderStage;
|
|
946
|
+
return ret;
|
|
947
|
+
},
|
|
948
|
+
__wbg_maxStorageBufferBindingSize_9ed12d54b564312c: function(arg0) {
|
|
949
|
+
const ret = getObject(arg0).maxStorageBufferBindingSize;
|
|
950
|
+
return ret;
|
|
951
|
+
},
|
|
952
|
+
__wbg_maxStorageBuffersPerShaderStage_7db5a7548c1199e6: function(arg0) {
|
|
953
|
+
const ret = getObject(arg0).maxStorageBuffersPerShaderStage;
|
|
954
|
+
return ret;
|
|
955
|
+
},
|
|
956
|
+
__wbg_maxStorageTexturesPerShaderStage_3df697d427690d26: function(arg0) {
|
|
957
|
+
const ret = getObject(arg0).maxStorageTexturesPerShaderStage;
|
|
958
|
+
return ret;
|
|
959
|
+
},
|
|
960
|
+
__wbg_maxTextureArrayLayers_759d0ac67e0a7d26: function(arg0) {
|
|
961
|
+
const ret = getObject(arg0).maxTextureArrayLayers;
|
|
962
|
+
return ret;
|
|
963
|
+
},
|
|
964
|
+
__wbg_maxTextureDimension1D_4bfdff8638ada7c1: function(arg0) {
|
|
965
|
+
const ret = getObject(arg0).maxTextureDimension1D;
|
|
966
|
+
return ret;
|
|
967
|
+
},
|
|
968
|
+
__wbg_maxTextureDimension2D_ea0c9c4d0b239666: function(arg0) {
|
|
969
|
+
const ret = getObject(arg0).maxTextureDimension2D;
|
|
970
|
+
return ret;
|
|
971
|
+
},
|
|
972
|
+
__wbg_maxTextureDimension3D_e76f3604806f47be: function(arg0) {
|
|
973
|
+
const ret = getObject(arg0).maxTextureDimension3D;
|
|
974
|
+
return ret;
|
|
975
|
+
},
|
|
976
|
+
__wbg_maxUniformBufferBindingSize_591ad000ffe10aad: function(arg0) {
|
|
977
|
+
const ret = getObject(arg0).maxUniformBufferBindingSize;
|
|
978
|
+
return ret;
|
|
979
|
+
},
|
|
980
|
+
__wbg_maxUniformBuffersPerShaderStage_6e5696dba506ca6c: function(arg0) {
|
|
981
|
+
const ret = getObject(arg0).maxUniformBuffersPerShaderStage;
|
|
982
|
+
return ret;
|
|
983
|
+
},
|
|
984
|
+
__wbg_maxVertexAttributes_fef434a4cf2ba188: function(arg0) {
|
|
985
|
+
const ret = getObject(arg0).maxVertexAttributes;
|
|
986
|
+
return ret;
|
|
987
|
+
},
|
|
988
|
+
__wbg_maxVertexBufferArrayStride_de60c38ec574b423: function(arg0) {
|
|
989
|
+
const ret = getObject(arg0).maxVertexBufferArrayStride;
|
|
990
|
+
return ret;
|
|
991
|
+
},
|
|
992
|
+
__wbg_maxVertexBuffers_d1a4a2fba06ae7d6: function(arg0) {
|
|
993
|
+
const ret = getObject(arg0).maxVertexBuffers;
|
|
994
|
+
return ret;
|
|
995
|
+
},
|
|
996
|
+
__wbg_message_8fd23df93c50075a: function(arg0, arg1) {
|
|
997
|
+
const ret = getObject(arg1).message;
|
|
998
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
999
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1000
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1001
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1002
|
+
},
|
|
1003
|
+
__wbg_message_b00edacf4a520b03: function(arg0, arg1) {
|
|
1004
|
+
const ret = getObject(arg1).message;
|
|
1005
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1006
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1007
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1008
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1009
|
+
},
|
|
1010
|
+
__wbg_message_d2eedafa0bd554a6: function(arg0, arg1) {
|
|
1011
|
+
const ret = getObject(arg1).message;
|
|
1012
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1013
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1014
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1015
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1016
|
+
},
|
|
1017
|
+
__wbg_messages_1df11461d071c92c: function(arg0) {
|
|
1018
|
+
const ret = getObject(arg0).messages;
|
|
1019
|
+
return addHeapObject(ret);
|
|
1020
|
+
},
|
|
1021
|
+
__wbg_minStorageBufferOffsetAlignment_49f6b6baa1d34111: function(arg0) {
|
|
1022
|
+
const ret = getObject(arg0).minStorageBufferOffsetAlignment;
|
|
1023
|
+
return ret;
|
|
1024
|
+
},
|
|
1025
|
+
__wbg_minUniformBufferOffsetAlignment_39ec7837ddc9ee2c: function(arg0) {
|
|
1026
|
+
const ret = getObject(arg0).minUniformBufferOffsetAlignment;
|
|
1027
|
+
return ret;
|
|
1028
|
+
},
|
|
1029
|
+
__wbg_navigator_3334c390f542c642: function(arg0) {
|
|
1030
|
+
const ret = getObject(arg0).navigator;
|
|
1031
|
+
return addHeapObject(ret);
|
|
1032
|
+
},
|
|
1033
|
+
__wbg_navigator_3db7ba343e05d4d1: function(arg0) {
|
|
1034
|
+
const ret = getObject(arg0).navigator;
|
|
1035
|
+
return addHeapObject(ret);
|
|
1036
|
+
},
|
|
1037
|
+
__wbg_new_02d162bc6cf02f60: function() {
|
|
1038
|
+
const ret = new Object();
|
|
1039
|
+
return addHeapObject(ret);
|
|
1040
|
+
},
|
|
1041
|
+
__wbg_new_227d7c05414eb861: function() {
|
|
1042
|
+
const ret = new Error();
|
|
1043
|
+
return addHeapObject(ret);
|
|
1044
|
+
},
|
|
1045
|
+
__wbg_new_310879b66b6e95e1: function() {
|
|
1046
|
+
const ret = new Array();
|
|
1047
|
+
return addHeapObject(ret);
|
|
1048
|
+
},
|
|
1049
|
+
__wbg_new_from_slice_269e35316ed2d061: function(arg0, arg1) {
|
|
1050
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
1051
|
+
return addHeapObject(ret);
|
|
1052
|
+
},
|
|
1053
|
+
__wbg_new_typed_c072c4ce9a2a0cdf: function(arg0, arg1) {
|
|
1054
|
+
try {
|
|
1055
|
+
var state0 = {a: arg0, b: arg1};
|
|
1056
|
+
var cb0 = (arg0, arg1) => {
|
|
1057
|
+
const a = state0.a;
|
|
1058
|
+
state0.a = 0;
|
|
1059
|
+
try {
|
|
1060
|
+
return __wasm_bindgen_func_elem_3263(a, state0.b, arg0, arg1);
|
|
1061
|
+
} finally {
|
|
1062
|
+
state0.a = a;
|
|
1063
|
+
}
|
|
1064
|
+
};
|
|
1065
|
+
const ret = new Promise(cb0);
|
|
1066
|
+
return addHeapObject(ret);
|
|
1067
|
+
} finally {
|
|
1068
|
+
state0.a = 0;
|
|
1069
|
+
}
|
|
1070
|
+
},
|
|
1071
|
+
__wbg_new_with_byte_offset_and_length_a87e79143162d67f: function(arg0, arg1, arg2) {
|
|
1072
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
1073
|
+
return addHeapObject(ret);
|
|
1074
|
+
},
|
|
1075
|
+
__wbg_offset_78dcfcd1f3ebc4ea: function(arg0) {
|
|
1076
|
+
const ret = getObject(arg0).offset;
|
|
1077
|
+
return ret;
|
|
1078
|
+
},
|
|
1079
|
+
__wbg_popErrorScope_efb23ea2dcc3b587: function(arg0) {
|
|
1080
|
+
const ret = getObject(arg0).popErrorScope();
|
|
1081
|
+
return addHeapObject(ret);
|
|
1082
|
+
},
|
|
1083
|
+
__wbg_prototypesetcall_5f9bdc8d75e07276: function(arg0, arg1, arg2) {
|
|
1084
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
1085
|
+
},
|
|
1086
|
+
__wbg_pushErrorScope_9a7570b7a9f67657: function(arg0, arg1) {
|
|
1087
|
+
getObject(arg0).pushErrorScope(__wbindgen_enum_GpuErrorFilter[arg1]);
|
|
1088
|
+
},
|
|
1089
|
+
__wbg_push_b77c476b01548d0a: function(arg0, arg1) {
|
|
1090
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
1091
|
+
return ret;
|
|
1092
|
+
},
|
|
1093
|
+
__wbg_querySelectorAll_0981bdbbafa5bf17: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1094
|
+
const ret = getObject(arg0).querySelectorAll(getStringFromWasm0(arg1, arg2));
|
|
1095
|
+
return addHeapObject(ret);
|
|
1096
|
+
}, arguments); },
|
|
1097
|
+
__wbg_queueMicrotask_78d584b53af520f5: function(arg0) {
|
|
1098
|
+
const ret = getObject(arg0).queueMicrotask;
|
|
1099
|
+
return addHeapObject(ret);
|
|
1100
|
+
},
|
|
1101
|
+
__wbg_queueMicrotask_b39ea83c7f01971a: function(arg0) {
|
|
1102
|
+
queueMicrotask(getObject(arg0));
|
|
1103
|
+
},
|
|
1104
|
+
__wbg_queue_9595c5175ef399b9: function(arg0) {
|
|
1105
|
+
const ret = getObject(arg0).queue;
|
|
1106
|
+
return addHeapObject(ret);
|
|
1107
|
+
},
|
|
1108
|
+
__wbg_reason_f9df4a653cfa764b: function(arg0) {
|
|
1109
|
+
const ret = getObject(arg0).reason;
|
|
1110
|
+
return (__wbindgen_enum_GpuDeviceLostReason.indexOf(ret) + 1 || 3) - 1;
|
|
1111
|
+
},
|
|
1112
|
+
__wbg_requestAdapter_592f04f645dfaf68: function(arg0, arg1) {
|
|
1113
|
+
const ret = getObject(arg0).requestAdapter(getObject(arg1));
|
|
1114
|
+
return addHeapObject(ret);
|
|
1115
|
+
},
|
|
1116
|
+
__wbg_requestDevice_52bb2980e6280ebc: function(arg0, arg1) {
|
|
1117
|
+
const ret = getObject(arg0).requestDevice(getObject(arg1));
|
|
1118
|
+
return addHeapObject(ret);
|
|
1119
|
+
},
|
|
1120
|
+
__wbg_resolveQuerySet_b316102e1d152b52: function(arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
1121
|
+
getObject(arg0).resolveQuerySet(getObject(arg1), arg2 >>> 0, arg3 >>> 0, getObject(arg4), arg5 >>> 0);
|
|
1122
|
+
},
|
|
1123
|
+
__wbg_resolve_d17db9352f5a220e: function(arg0) {
|
|
1124
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
1125
|
+
return addHeapObject(ret);
|
|
1126
|
+
},
|
|
1127
|
+
__wbg_setBindGroup_0fb411b7d1ec4966: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
|
|
1128
|
+
getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2), getArrayU32FromWasm0(arg3, arg4), arg5, arg6 >>> 0);
|
|
1129
|
+
},
|
|
1130
|
+
__wbg_setBindGroup_1c6bfc705c95f81f: function(arg0, arg1, arg2) {
|
|
1131
|
+
getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2));
|
|
1132
|
+
},
|
|
1133
|
+
__wbg_setBindGroup_2ec8db65419ec50c: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
|
|
1134
|
+
getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2), getArrayU32FromWasm0(arg3, arg4), arg5, arg6 >>> 0);
|
|
1135
|
+
},
|
|
1136
|
+
__wbg_setBindGroup_3afbefd496741277: function(arg0, arg1, arg2) {
|
|
1137
|
+
getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2));
|
|
1138
|
+
},
|
|
1139
|
+
__wbg_setBindGroup_4ac51c0e16178380: function(arg0, arg1, arg2) {
|
|
1140
|
+
getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2));
|
|
1141
|
+
},
|
|
1142
|
+
__wbg_setBindGroup_c2fbfec522cc7572: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
|
|
1143
|
+
getObject(arg0).setBindGroup(arg1 >>> 0, getObject(arg2), getArrayU32FromWasm0(arg3, arg4), arg5, arg6 >>> 0);
|
|
1144
|
+
},
|
|
1145
|
+
__wbg_setBlendConstant_00bed453ac51c91b: function(arg0, arg1) {
|
|
1146
|
+
getObject(arg0).setBlendConstant(getObject(arg1));
|
|
1147
|
+
},
|
|
1148
|
+
__wbg_setIndexBuffer_42017bb879ab062b: function(arg0, arg1, arg2, arg3) {
|
|
1149
|
+
getObject(arg0).setIndexBuffer(getObject(arg1), __wbindgen_enum_GpuIndexFormat[arg2], arg3);
|
|
1150
|
+
},
|
|
1151
|
+
__wbg_setIndexBuffer_4876c05f77106bb6: function(arg0, arg1, arg2, arg3, arg4) {
|
|
1152
|
+
getObject(arg0).setIndexBuffer(getObject(arg1), __wbindgen_enum_GpuIndexFormat[arg2], arg3, arg4);
|
|
1153
|
+
},
|
|
1154
|
+
__wbg_setIndexBuffer_8c79ee0b0b6460fa: function(arg0, arg1, arg2, arg3) {
|
|
1155
|
+
getObject(arg0).setIndexBuffer(getObject(arg1), __wbindgen_enum_GpuIndexFormat[arg2], arg3);
|
|
1156
|
+
},
|
|
1157
|
+
__wbg_setIndexBuffer_e10a7cf5d063fdab: function(arg0, arg1, arg2, arg3, arg4) {
|
|
1158
|
+
getObject(arg0).setIndexBuffer(getObject(arg1), __wbindgen_enum_GpuIndexFormat[arg2], arg3, arg4);
|
|
1159
|
+
},
|
|
1160
|
+
__wbg_setPipeline_5c5a949bf12f8a5f: function(arg0, arg1) {
|
|
1161
|
+
getObject(arg0).setPipeline(getObject(arg1));
|
|
1162
|
+
},
|
|
1163
|
+
__wbg_setPipeline_c4793bebd98b8e56: function(arg0, arg1) {
|
|
1164
|
+
getObject(arg0).setPipeline(getObject(arg1));
|
|
1165
|
+
},
|
|
1166
|
+
__wbg_setPipeline_ce7a683c2c94919d: function(arg0, arg1) {
|
|
1167
|
+
getObject(arg0).setPipeline(getObject(arg1));
|
|
1168
|
+
},
|
|
1169
|
+
__wbg_setScissorRect_cf24179de05b8393: function(arg0, arg1, arg2, arg3, arg4) {
|
|
1170
|
+
getObject(arg0).setScissorRect(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0);
|
|
1171
|
+
},
|
|
1172
|
+
__wbg_setStencilReference_7a98f054e2f31f54: function(arg0, arg1) {
|
|
1173
|
+
getObject(arg0).setStencilReference(arg1 >>> 0);
|
|
1174
|
+
},
|
|
1175
|
+
__wbg_setVertexBuffer_06dd033f8e75af24: function(arg0, arg1, arg2, arg3) {
|
|
1176
|
+
getObject(arg0).setVertexBuffer(arg1 >>> 0, getObject(arg2), arg3);
|
|
1177
|
+
},
|
|
1178
|
+
__wbg_setVertexBuffer_c973cd35605098e4: function(arg0, arg1, arg2, arg3, arg4) {
|
|
1179
|
+
getObject(arg0).setVertexBuffer(arg1 >>> 0, getObject(arg2), arg3, arg4);
|
|
1180
|
+
},
|
|
1181
|
+
__wbg_setVertexBuffer_e80315ecd1774568: function(arg0, arg1, arg2, arg3) {
|
|
1182
|
+
getObject(arg0).setVertexBuffer(arg1 >>> 0, getObject(arg2), arg3);
|
|
1183
|
+
},
|
|
1184
|
+
__wbg_setVertexBuffer_ef41a6013dba1352: function(arg0, arg1, arg2, arg3, arg4) {
|
|
1185
|
+
getObject(arg0).setVertexBuffer(arg1 >>> 0, getObject(arg2), arg3, arg4);
|
|
1186
|
+
},
|
|
1187
|
+
__wbg_setViewport_75637b1c9a301986: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
|
|
1188
|
+
getObject(arg0).setViewport(arg1, arg2, arg3, arg4, arg5, arg6);
|
|
1189
|
+
},
|
|
1190
|
+
__wbg_set_37221b90dcdc9a98: function(arg0, arg1, arg2) {
|
|
1191
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
1192
|
+
},
|
|
1193
|
+
__wbg_set_a0e911be3da02782: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1194
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
1195
|
+
return ret;
|
|
1196
|
+
}, arguments); },
|
|
1197
|
+
__wbg_set_height_bb0dc35fd1d941f5: function(arg0, arg1) {
|
|
1198
|
+
getObject(arg0).height = arg1 >>> 0;
|
|
1199
|
+
},
|
|
1200
|
+
__wbg_set_height_bdd58e6b04e88cca: function(arg0, arg1) {
|
|
1201
|
+
getObject(arg0).height = arg1 >>> 0;
|
|
1202
|
+
},
|
|
1203
|
+
__wbg_set_onuncapturederror_5c20c4125b115c22: function(arg0, arg1) {
|
|
1204
|
+
getObject(arg0).onuncapturederror = getObject(arg1);
|
|
1205
|
+
},
|
|
1206
|
+
__wbg_set_width_25112eb6bf1148df: function(arg0, arg1) {
|
|
1207
|
+
getObject(arg0).width = arg1 >>> 0;
|
|
1208
|
+
},
|
|
1209
|
+
__wbg_set_width_9d385df435c1f79d: function(arg0, arg1) {
|
|
1210
|
+
getObject(arg0).width = arg1 >>> 0;
|
|
1211
|
+
},
|
|
1212
|
+
__wbg_size_b5c1b72884cb3fa5: function(arg0) {
|
|
1213
|
+
const ret = getObject(arg0).size;
|
|
1214
|
+
return ret;
|
|
1215
|
+
},
|
|
1216
|
+
__wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
|
|
1217
|
+
const ret = getObject(arg1).stack;
|
|
1218
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1219
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1220
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1221
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1222
|
+
},
|
|
1223
|
+
__wbg_static_accessor_GLOBAL_THIS_02344c9b09eb08a9: function() {
|
|
1224
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1225
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1226
|
+
},
|
|
1227
|
+
__wbg_static_accessor_GLOBAL_ac6d4ac874d5cd54: function() {
|
|
1228
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
1229
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1230
|
+
},
|
|
1231
|
+
__wbg_static_accessor_SELF_9b2406c23aeb2023: function() {
|
|
1232
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
1233
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1234
|
+
},
|
|
1235
|
+
__wbg_static_accessor_WINDOW_b34d2126934e16ba: function() {
|
|
1236
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
1237
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1238
|
+
},
|
|
1239
|
+
__wbg_submit_6ffa2ed48b3eaecf: function(arg0, arg1) {
|
|
1240
|
+
getObject(arg0).submit(getObject(arg1));
|
|
1241
|
+
},
|
|
1242
|
+
__wbg_then_7b57a40e3ee05615: function(arg0, arg1) {
|
|
1243
|
+
const ret = getObject(arg0).then(getObject(arg1));
|
|
1244
|
+
return addHeapObject(ret);
|
|
1245
|
+
},
|
|
1246
|
+
__wbg_then_837494e384b37459: function(arg0, arg1) {
|
|
1247
|
+
const ret = getObject(arg0).then(getObject(arg1));
|
|
1248
|
+
return addHeapObject(ret);
|
|
1249
|
+
},
|
|
1250
|
+
__wbg_then_87e0b598b245104b: function(arg0, arg1, arg2) {
|
|
1251
|
+
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
1252
|
+
return addHeapObject(ret);
|
|
1253
|
+
},
|
|
1254
|
+
__wbg_then_bd927500e8905df2: function(arg0, arg1, arg2) {
|
|
1255
|
+
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
1256
|
+
return addHeapObject(ret);
|
|
1257
|
+
},
|
|
1258
|
+
__wbg_type_ba6bfed8f5073b9e: function(arg0) {
|
|
1259
|
+
const ret = getObject(arg0).type;
|
|
1260
|
+
return (__wbindgen_enum_GpuCompilationMessageType.indexOf(ret) + 1 || 4) - 1;
|
|
1261
|
+
},
|
|
1262
|
+
__wbg_unmap_d610a495d70ebb5e: function(arg0) {
|
|
1263
|
+
getObject(arg0).unmap();
|
|
1264
|
+
},
|
|
1265
|
+
__wbg_usage_92ae9f7605bb82c1: function(arg0) {
|
|
1266
|
+
const ret = getObject(arg0).usage;
|
|
1267
|
+
return ret;
|
|
1268
|
+
},
|
|
1269
|
+
__wbg_valueOf_b63066c353d826b6: function(arg0) {
|
|
1270
|
+
const ret = getObject(arg0).valueOf();
|
|
1271
|
+
return addHeapObject(ret);
|
|
1272
|
+
},
|
|
1273
|
+
__wbg_warn_c4e0780980765a86: function(arg0) {
|
|
1274
|
+
console.warn(getObject(arg0));
|
|
1275
|
+
},
|
|
1276
|
+
__wbg_wasmgpurenderer_new: function(arg0) {
|
|
1277
|
+
const ret = WasmGpuRenderer.__wrap(arg0);
|
|
1278
|
+
return addHeapObject(ret);
|
|
1279
|
+
},
|
|
1280
|
+
__wbg_wasmviewscriptengine_new: function(arg0) {
|
|
1281
|
+
const ret = WasmViewScriptEngine.__wrap(arg0);
|
|
1282
|
+
return addHeapObject(ret);
|
|
1283
|
+
},
|
|
1284
|
+
__wbg_width_e987166926c3367c: function(arg0) {
|
|
1285
|
+
const ret = getObject(arg0).width;
|
|
1286
|
+
return ret;
|
|
1287
|
+
},
|
|
1288
|
+
__wbg_writeBuffer_28f398e6955ad305: function(arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
1289
|
+
getObject(arg0).writeBuffer(getObject(arg1), arg2, getObject(arg3), arg4, arg5);
|
|
1290
|
+
},
|
|
1291
|
+
__wbg_writeTexture_4eafae0e29b3eac0: function(arg0, arg1, arg2, arg3, arg4) {
|
|
1292
|
+
getObject(arg0).writeTexture(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4));
|
|
1293
|
+
},
|
|
1294
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1295
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 151, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1296
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_1613);
|
|
1297
|
+
return addHeapObject(ret);
|
|
1298
|
+
},
|
|
1299
|
+
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1300
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 370, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1301
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3241);
|
|
1302
|
+
return addHeapObject(ret);
|
|
1303
|
+
},
|
|
1304
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
1305
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 151, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1306
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_1613_2);
|
|
1307
|
+
return addHeapObject(ret);
|
|
1308
|
+
},
|
|
1309
|
+
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
1310
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
1311
|
+
const ret = arg0;
|
|
1312
|
+
return addHeapObject(ret);
|
|
1313
|
+
},
|
|
1314
|
+
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
1315
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
1316
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
1317
|
+
return addHeapObject(ret);
|
|
1318
|
+
},
|
|
1319
|
+
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
1320
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1321
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1322
|
+
return addHeapObject(ret);
|
|
1323
|
+
},
|
|
1324
|
+
__wbindgen_object_clone_ref: function(arg0) {
|
|
1325
|
+
const ret = getObject(arg0);
|
|
1326
|
+
return addHeapObject(ret);
|
|
1327
|
+
},
|
|
1328
|
+
__wbindgen_object_drop_ref: function(arg0) {
|
|
1329
|
+
takeObject(arg0);
|
|
1330
|
+
},
|
|
1331
|
+
};
|
|
1332
|
+
return {
|
|
1333
|
+
__proto__: null,
|
|
1334
|
+
"./vsc_wasm_bg.js": import0,
|
|
1335
|
+
};
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
function __wasm_bindgen_func_elem_1613(arg0, arg1, arg2) {
|
|
1339
|
+
wasm.__wasm_bindgen_func_elem_1613(arg0, arg1, addHeapObject(arg2));
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
function __wasm_bindgen_func_elem_1613_2(arg0, arg1, arg2) {
|
|
1343
|
+
wasm.__wasm_bindgen_func_elem_1613_2(arg0, arg1, addHeapObject(arg2));
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
function __wasm_bindgen_func_elem_3241(arg0, arg1, arg2) {
|
|
1347
|
+
try {
|
|
1348
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1349
|
+
wasm.__wasm_bindgen_func_elem_3241(retptr, arg0, arg1, addHeapObject(arg2));
|
|
1350
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1351
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1352
|
+
if (r1) {
|
|
1353
|
+
throw takeObject(r0);
|
|
1354
|
+
}
|
|
1355
|
+
} finally {
|
|
1356
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
function __wasm_bindgen_func_elem_3263(arg0, arg1, arg2, arg3) {
|
|
1361
|
+
wasm.__wasm_bindgen_func_elem_3263(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
|
|
1365
|
+
const __wbindgen_enum_GpuCompilationMessageType = ["error", "warning", "info"];
|
|
1366
|
+
|
|
1367
|
+
|
|
1368
|
+
const __wbindgen_enum_GpuDeviceLostReason = ["unknown", "destroyed"];
|
|
1369
|
+
|
|
1370
|
+
|
|
1371
|
+
const __wbindgen_enum_GpuErrorFilter = ["validation", "out-of-memory", "internal"];
|
|
1372
|
+
|
|
1373
|
+
|
|
1374
|
+
const __wbindgen_enum_GpuIndexFormat = ["uint16", "uint32"];
|
|
1375
|
+
|
|
1376
|
+
|
|
1377
|
+
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"];
|
|
1378
|
+
const WasmGpuRendererFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1379
|
+
? { register: () => {}, unregister: () => {} }
|
|
1380
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmgpurenderer_free(ptr, 1));
|
|
1381
|
+
const WasmViewScriptEngineFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1382
|
+
? { register: () => {}, unregister: () => {} }
|
|
1383
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmviewscriptengine_free(ptr, 1));
|
|
1384
|
+
|
|
1385
|
+
function addHeapObject(obj) {
|
|
1386
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
1387
|
+
const idx = heap_next;
|
|
1388
|
+
heap_next = heap[idx];
|
|
1389
|
+
|
|
1390
|
+
heap[idx] = obj;
|
|
1391
|
+
return idx;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
1395
|
+
? { register: () => {}, unregister: () => {} }
|
|
1396
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_export5(state.a, state.b));
|
|
1397
|
+
|
|
1398
|
+
function debugString(val) {
|
|
1399
|
+
// primitive types
|
|
1400
|
+
const type = typeof val;
|
|
1401
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
1402
|
+
return `${val}`;
|
|
1403
|
+
}
|
|
1404
|
+
if (type == 'string') {
|
|
1405
|
+
return `"${val}"`;
|
|
1406
|
+
}
|
|
1407
|
+
if (type == 'symbol') {
|
|
1408
|
+
const description = val.description;
|
|
1409
|
+
if (description == null) {
|
|
1410
|
+
return 'Symbol';
|
|
1411
|
+
} else {
|
|
1412
|
+
return `Symbol(${description})`;
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
if (type == 'function') {
|
|
1416
|
+
const name = val.name;
|
|
1417
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
1418
|
+
return `Function(${name})`;
|
|
1419
|
+
} else {
|
|
1420
|
+
return 'Function';
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
// objects
|
|
1424
|
+
if (Array.isArray(val)) {
|
|
1425
|
+
const length = val.length;
|
|
1426
|
+
let debug = '[';
|
|
1427
|
+
if (length > 0) {
|
|
1428
|
+
debug += debugString(val[0]);
|
|
1429
|
+
}
|
|
1430
|
+
for(let i = 1; i < length; i++) {
|
|
1431
|
+
debug += ', ' + debugString(val[i]);
|
|
1432
|
+
}
|
|
1433
|
+
debug += ']';
|
|
1434
|
+
return debug;
|
|
1435
|
+
}
|
|
1436
|
+
// Test for built-in
|
|
1437
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
1438
|
+
let className;
|
|
1439
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
1440
|
+
className = builtInMatches[1];
|
|
1441
|
+
} else {
|
|
1442
|
+
// Failed to match the standard '[object ClassName]'
|
|
1443
|
+
return toString.call(val);
|
|
1444
|
+
}
|
|
1445
|
+
if (className == 'Object') {
|
|
1446
|
+
// we're a user defined class or Object
|
|
1447
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
1448
|
+
// easier than looping through ownProperties of `val`.
|
|
1449
|
+
try {
|
|
1450
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
1451
|
+
} catch (_) {
|
|
1452
|
+
return 'Object';
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
// errors
|
|
1456
|
+
if (val instanceof Error) {
|
|
1457
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
1458
|
+
}
|
|
1459
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
1460
|
+
return className;
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
function dropObject(idx) {
|
|
1464
|
+
if (idx < 1028) return;
|
|
1465
|
+
heap[idx] = heap_next;
|
|
1466
|
+
heap_next = idx;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
1470
|
+
ptr = ptr >>> 0;
|
|
1471
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
1475
|
+
ptr = ptr >>> 0;
|
|
1476
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
let cachedDataViewMemory0 = null;
|
|
1480
|
+
function getDataViewMemory0() {
|
|
1481
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
1482
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
1483
|
+
}
|
|
1484
|
+
return cachedDataViewMemory0;
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
function getStringFromWasm0(ptr, len) {
|
|
1488
|
+
return decodeText(ptr >>> 0, len);
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
let cachedUint32ArrayMemory0 = null;
|
|
1492
|
+
function getUint32ArrayMemory0() {
|
|
1493
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
1494
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
1495
|
+
}
|
|
1496
|
+
return cachedUint32ArrayMemory0;
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
let cachedUint8ArrayMemory0 = null;
|
|
1500
|
+
function getUint8ArrayMemory0() {
|
|
1501
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
1502
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
1503
|
+
}
|
|
1504
|
+
return cachedUint8ArrayMemory0;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
function getObject(idx) { return heap[idx]; }
|
|
1508
|
+
|
|
1509
|
+
function handleError(f, args) {
|
|
1510
|
+
try {
|
|
1511
|
+
return f.apply(this, args);
|
|
1512
|
+
} catch (e) {
|
|
1513
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
let heap = new Array(1024).fill(undefined);
|
|
1518
|
+
heap.push(undefined, null, true, false);
|
|
1519
|
+
|
|
1520
|
+
let heap_next = heap.length;
|
|
1521
|
+
|
|
1522
|
+
function isLikeNone(x) {
|
|
1523
|
+
return x === undefined || x === null;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
function makeMutClosure(arg0, arg1, f) {
|
|
1527
|
+
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
1528
|
+
const real = (...args) => {
|
|
1529
|
+
|
|
1530
|
+
// First up with a closure we increment the internal reference
|
|
1531
|
+
// count. This ensures that the Rust closure environment won't
|
|
1532
|
+
// be deallocated while we're invoking it.
|
|
1533
|
+
state.cnt++;
|
|
1534
|
+
const a = state.a;
|
|
1535
|
+
state.a = 0;
|
|
1536
|
+
try {
|
|
1537
|
+
return f(a, state.b, ...args);
|
|
1538
|
+
} finally {
|
|
1539
|
+
state.a = a;
|
|
1540
|
+
real._wbg_cb_unref();
|
|
1541
|
+
}
|
|
1542
|
+
};
|
|
1543
|
+
real._wbg_cb_unref = () => {
|
|
1544
|
+
if (--state.cnt === 0) {
|
|
1545
|
+
wasm.__wbindgen_export5(state.a, state.b);
|
|
1546
|
+
state.a = 0;
|
|
1547
|
+
CLOSURE_DTORS.unregister(state);
|
|
1548
|
+
}
|
|
1549
|
+
};
|
|
1550
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
1551
|
+
return real;
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
1555
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1556
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
1557
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1558
|
+
return ptr;
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
1562
|
+
if (realloc === undefined) {
|
|
1563
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1564
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
1565
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
1566
|
+
WASM_VECTOR_LEN = buf.length;
|
|
1567
|
+
return ptr;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
let len = arg.length;
|
|
1571
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1572
|
+
|
|
1573
|
+
const mem = getUint8ArrayMemory0();
|
|
1574
|
+
|
|
1575
|
+
let offset = 0;
|
|
1576
|
+
|
|
1577
|
+
for (; offset < len; offset++) {
|
|
1578
|
+
const code = arg.charCodeAt(offset);
|
|
1579
|
+
if (code > 0x7F) break;
|
|
1580
|
+
mem[ptr + offset] = code;
|
|
1581
|
+
}
|
|
1582
|
+
if (offset !== len) {
|
|
1583
|
+
if (offset !== 0) {
|
|
1584
|
+
arg = arg.slice(offset);
|
|
1585
|
+
}
|
|
1586
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1587
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1588
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1589
|
+
|
|
1590
|
+
offset += ret.written;
|
|
1591
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
WASM_VECTOR_LEN = offset;
|
|
1595
|
+
return ptr;
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
function takeObject(idx) {
|
|
1599
|
+
const ret = getObject(idx);
|
|
1600
|
+
dropObject(idx);
|
|
1601
|
+
return ret;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1605
|
+
cachedTextDecoder.decode();
|
|
1606
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1607
|
+
let numBytesDecoded = 0;
|
|
1608
|
+
function decodeText(ptr, len) {
|
|
1609
|
+
numBytesDecoded += len;
|
|
1610
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1611
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1612
|
+
cachedTextDecoder.decode();
|
|
1613
|
+
numBytesDecoded = len;
|
|
1614
|
+
}
|
|
1615
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1619
|
+
|
|
1620
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1621
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1622
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1623
|
+
view.set(buf);
|
|
1624
|
+
return {
|
|
1625
|
+
read: arg.length,
|
|
1626
|
+
written: buf.length
|
|
1627
|
+
};
|
|
1628
|
+
};
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
let WASM_VECTOR_LEN = 0;
|
|
1632
|
+
|
|
1633
|
+
let wasmModule, wasmInstance, wasm;
|
|
1634
|
+
function __wbg_finalize_init(instance, module) {
|
|
1635
|
+
wasmInstance = instance;
|
|
1636
|
+
wasm = instance.exports;
|
|
1637
|
+
wasmModule = module;
|
|
1638
|
+
cachedDataViewMemory0 = null;
|
|
1639
|
+
cachedUint32ArrayMemory0 = null;
|
|
1640
|
+
cachedUint8ArrayMemory0 = null;
|
|
1641
|
+
return wasm;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
async function __wbg_load(module, imports) {
|
|
1645
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
1646
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1647
|
+
try {
|
|
1648
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1649
|
+
} catch (e) {
|
|
1650
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
1651
|
+
|
|
1652
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
1653
|
+
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);
|
|
1654
|
+
|
|
1655
|
+
} else { throw e; }
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
const bytes = await module.arrayBuffer();
|
|
1660
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1661
|
+
} else {
|
|
1662
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1663
|
+
|
|
1664
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1665
|
+
return { instance, module };
|
|
1666
|
+
} else {
|
|
1667
|
+
return instance;
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
function expectedResponseType(type) {
|
|
1672
|
+
switch (type) {
|
|
1673
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
1674
|
+
}
|
|
1675
|
+
return false;
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
function initSync(module) {
|
|
1680
|
+
if (wasm !== undefined) return wasm;
|
|
1681
|
+
|
|
1682
|
+
|
|
1683
|
+
if (module !== undefined) {
|
|
1684
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1685
|
+
({module} = module)
|
|
1686
|
+
} else {
|
|
1687
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
const imports = __wbg_get_imports();
|
|
1692
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
1693
|
+
module = new WebAssembly.Module(module);
|
|
1694
|
+
}
|
|
1695
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
1696
|
+
return __wbg_finalize_init(instance, module);
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
async function __wbg_init(module_or_path) {
|
|
1700
|
+
if (wasm !== undefined) return wasm;
|
|
1701
|
+
|
|
1702
|
+
|
|
1703
|
+
if (module_or_path !== undefined) {
|
|
1704
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1705
|
+
({module_or_path} = module_or_path)
|
|
1706
|
+
} else {
|
|
1707
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
if (module_or_path === undefined) {
|
|
1712
|
+
module_or_path = new URL('vsc_wasm_bg.wasm', import.meta.url);
|
|
1713
|
+
}
|
|
1714
|
+
const imports = __wbg_get_imports();
|
|
1715
|
+
|
|
1716
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1717
|
+
module_or_path = fetch(module_or_path);
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1721
|
+
|
|
1722
|
+
return __wbg_finalize_init(instance, module);
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
export { initSync, __wbg_init as default };
|