webgl2 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/coverage.md +38 -38
- package/package.json +1 -1
- package/src/webgl2_context.js +55 -63
- package/webgl2.debug.wasm +0 -0
- package/webgl2.wasm +0 -0
package/coverage.md
CHANGED
|
@@ -4,52 +4,52 @@
|
|
|
4
4
|
|
|
5
5
|
| File | Lines Covered | Lines Missed | Total Lines | Coverage |
|
|
6
6
|
|---|---|---|---|---:|
|
|
7
|
-
| src/coverage.rs |
|
|
8
|
-
| src/decompiler/ast.rs |
|
|
9
|
-
| src/decompiler/emitter.rs |
|
|
7
|
+
| src/coverage.rs | 11 | 5 | 16 | 68.75% 🟡 |
|
|
8
|
+
| src/decompiler/ast.rs | 3 | 5 | 8 | 37.50% 🟠 |
|
|
9
|
+
| src/decompiler/emitter.rs | 30 | 3 | 33 | 90.91% 🟢 |
|
|
10
10
|
| src/decompiler/lifter.rs | 6 | 2 | 8 | 75.00% 🟡 |
|
|
11
|
-
| src/decompiler/parser.rs |
|
|
12
|
-
| src/decompiler/simplifier.rs |
|
|
13
|
-
| src/error.rs |
|
|
14
|
-
| src/lib.rs |
|
|
15
|
-
| src/naga_wasm_backend/backend.rs |
|
|
11
|
+
| src/decompiler/parser.rs | 2 | 1 | 3 | 66.67% 🟡 |
|
|
12
|
+
| src/decompiler/simplifier.rs | 35 | 2 | 37 | 94.59% 🟢 |
|
|
13
|
+
| src/error.rs | 32 | 5 | 37 | 86.49% 🟢 |
|
|
14
|
+
| src/lib.rs | 144 | 305 | 449 | 32.07% 🟠 |
|
|
15
|
+
| src/naga_wasm_backend/backend.rs | 154 | 28 | 182 | 84.62% 🟢 |
|
|
16
16
|
| src/naga_wasm_backend/call_lowering.rs | 9 | 3 | 12 | 75.00% 🟡 |
|
|
17
|
-
| src/naga_wasm_backend/control_flow.rs | 38 |
|
|
18
|
-
| src/naga_wasm_backend/debug/stub.rs | 11 |
|
|
19
|
-
| src/naga_wasm_backend/expressions.rs |
|
|
20
|
-
| src/naga_wasm_backend/function_abi.rs |
|
|
17
|
+
| src/naga_wasm_backend/control_flow.rs | 38 | 29 | 67 | 56.72% 🟡 |
|
|
18
|
+
| src/naga_wasm_backend/debug/stub.rs | 11 | 15 | 26 | 42.31% 🟠 |
|
|
19
|
+
| src/naga_wasm_backend/expressions.rs | 255 | 149 | 404 | 63.12% 🟡 |
|
|
20
|
+
| src/naga_wasm_backend/function_abi.rs | 19 | 5 | 24 | 79.17% 🟡 |
|
|
21
21
|
| src/naga_wasm_backend/functions/prep.rs | 5 | 0 | 5 | 100.00% 🟢 |
|
|
22
22
|
| src/naga_wasm_backend/functions/registry.rs | 6 | 0 | 6 | 100.00% 🟢 |
|
|
23
23
|
| src/naga_wasm_backend/memory_layout.rs | 15 | 1 | 16 | 93.75% 🟢 |
|
|
24
|
-
| src/naga_wasm_backend/mod.rs |
|
|
25
|
-
| src/naga_wasm_backend/output_layout.rs |
|
|
26
|
-
| src/naga_wasm_backend/types.rs | 22 |
|
|
27
|
-
| src/wasm_gl_emu/device.rs | 3 |
|
|
24
|
+
| src/naga_wasm_backend/mod.rs | 7 | 0 | 7 | 100.00% 🟢 |
|
|
25
|
+
| src/naga_wasm_backend/output_layout.rs | 5 | 0 | 5 | 100.00% 🟢 |
|
|
26
|
+
| src/naga_wasm_backend/types.rs | 22 | 5 | 27 | 81.48% 🟢 |
|
|
27
|
+
| src/wasm_gl_emu/device.rs | 3 | 2 | 5 | 60.00% 🟡 |
|
|
28
28
|
| src/wasm_gl_emu/framebuffer.rs | 1 | 0 | 1 | 100.00% 🟢 |
|
|
29
|
-
| src/wasm_gl_emu/rasterizer.rs |
|
|
30
|
-
| src/wasm_gl_emu/transfer.rs |
|
|
31
|
-
| src/webgl2_context/
|
|
32
|
-
| src/webgl2_context/
|
|
33
|
-
| src/webgl2_context/
|
|
34
|
-
| src/webgl2_context/
|
|
35
|
-
| src/webgl2_context/
|
|
36
|
-
| src/webgl2_context/
|
|
37
|
-
| src/webgl2_context/
|
|
38
|
-
| src/webgl2_context/
|
|
39
|
-
| src/
|
|
40
|
-
| src/
|
|
41
|
-
| src/webgpu/
|
|
42
|
-
| src/webgpu/
|
|
43
|
-
| src/webgpu/
|
|
44
|
-
| src/webgpu/
|
|
45
|
-
| src/webgpu/
|
|
46
|
-
| **Total** | **
|
|
29
|
+
| src/wasm_gl_emu/rasterizer.rs | 17 | 41 | 58 | 29.31% 🟠 |
|
|
30
|
+
| src/wasm_gl_emu/transfer.rs | 0 | 2 | 2 | 0.00% 🟡 |
|
|
31
|
+
| src/webgl2_context/buffers.rs | 14 | 0 | 14 | 100.00% 🟢 |
|
|
32
|
+
| src/webgl2_context/drawing.rs | 30 | 0 | 30 | 100.00% 🟢 |
|
|
33
|
+
| src/webgl2_context/ephemeral.rs | 3 | 0 | 3 | 100.00% 🟢 |
|
|
34
|
+
| src/webgl2_context/registry.rs | 10 | 0 | 10 | 100.00% 🟢 |
|
|
35
|
+
| src/webgl2_context/shaders.rs | 141 | 27 | 168 | 83.93% 🟢 |
|
|
36
|
+
| src/webgl2_context/state.rs | 2 | 0 | 2 | 100.00% 🟢 |
|
|
37
|
+
| src/webgl2_context/textures.rs | 59 | 0 | 59 | 100.00% 🟢 |
|
|
38
|
+
| src/webgl2_context/types.rs | 46 | 17 | 63 | 73.02% 🟡 |
|
|
39
|
+
| src/webgpu/adapter.rs | 5 | 0 | 5 | 100.00% 🟢 |
|
|
40
|
+
| src/webgpu/backend.rs | 61 | 21 | 82 | 74.39% 🟡 |
|
|
41
|
+
| src/webgpu/bind_group.rs | 3 | 0 | 3 | 100.00% 🟢 |
|
|
42
|
+
| src/webgpu/buffer.rs | 1 | 2 | 3 | 33.33% 🟡 |
|
|
43
|
+
| src/webgpu/command.rs | 7 | 5 | 12 | 58.33% 🟡 |
|
|
44
|
+
| src/webgpu/shader.rs | 1 | 0 | 1 | 100.00% 🟢 |
|
|
45
|
+
| src/webgpu/texture.rs | 8 | 4 | 12 | 66.67% 🟡 |
|
|
46
|
+
| **Total** | **1221** | **684** | **1905** | **64.09% 🟡** |
|
|
47
47
|
|
|
48
48
|
## Top Missed Files
|
|
49
49
|
|
|
50
50
|
| File | Lines Missed | Illustrative Line | Coverage |
|
|
51
51
|
|---|---|---|---:|
|
|
52
|
-
| src/lib.rs |
|
|
53
|
-
| src/naga_wasm_backend/expressions.rs |
|
|
54
|
-
| src/wasm_gl_emu/rasterizer.rs | 41/
|
|
55
|
-
| src/naga_wasm_backend/control_flow.rs |
|
|
52
|
+
| src/lib.rs | 305/449 | [1994] `depth_write_enabled: u32,` | 32.07% 🟠 |
|
|
53
|
+
| src/naga_wasm_backend/expressions.rs | 149/404 | [910] `if let Some(handle) = found_global {` | 63.12% 🟡 |
|
|
54
|
+
| src/wasm_gl_emu/rasterizer.rs | 41/58 | [370] `match eq {` | 29.31% 🟠 |
|
|
55
|
+
| src/naga_wasm_backend/control_flow.rs | 29/67 | [489] `let types = super::types::naga_to_wasm_types(` | 56.72% 🟡 |
|
package/package.json
CHANGED
package/src/webgl2_context.js
CHANGED
|
@@ -2219,10 +2219,6 @@ export class WasmWebGL2RenderingContext {
|
|
|
2219
2219
|
throw new Error('wasm_ctx_get_parameter not found');
|
|
2220
2220
|
}
|
|
2221
2221
|
|
|
2222
|
-
if (pname === 0x8869 /* MAX_VERTEX_ATTRIBS */) {
|
|
2223
|
-
return 16;
|
|
2224
|
-
}
|
|
2225
|
-
|
|
2226
2222
|
const ptr = ex.wasm_ctx_get_parameter(this._ctxHandle, pname);
|
|
2227
2223
|
if (ptr === 0) {
|
|
2228
2224
|
return null;
|
|
@@ -2230,71 +2226,67 @@ export class WasmWebGL2RenderingContext {
|
|
|
2230
2226
|
|
|
2231
2227
|
const dv = new DataView(ex.memory.buffer);
|
|
2232
2228
|
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
if (pname === 0x0C22 /* COLOR_CLEAR_VALUE */) {
|
|
2244
|
-
return new Float32Array(ex.memory.buffer.slice(ptr, ptr + 16));
|
|
2245
|
-
}
|
|
2246
|
-
|
|
2247
|
-
if (pname === 0x0C23 /* COLOR_WRITEMASK */) {
|
|
2248
|
-
const mem = new Uint8Array(ex.memory.buffer, ptr, 4);
|
|
2249
|
-
return [mem[0] !== 0, mem[1] !== 0, mem[2] !== 0, mem[3] !== 0];
|
|
2250
|
-
}
|
|
2251
|
-
|
|
2252
|
-
if (pname === 0x8CA6 /* DRAW_FRAMEBUFFER_BINDING */ || pname === 0x8CAA /* READ_FRAMEBUFFER_BINDING */) {
|
|
2253
|
-
const handle = dv.getInt32(ptr, true);
|
|
2254
|
-
if (handle === 0) return null;
|
|
2255
|
-
return this._fbHandles.get(handle) || null;
|
|
2256
|
-
}
|
|
2257
|
-
|
|
2258
|
-
if (pname === 0x8CA7 /* RENDERBUFFER_BINDING */) {
|
|
2259
|
-
const handle = dv.getInt32(ptr, true);
|
|
2260
|
-
if (handle === 0) return null;
|
|
2261
|
-
return this._rbHandles.get(handle) || null;
|
|
2262
|
-
}
|
|
2229
|
+
switch (pname) {
|
|
2230
|
+
case this.VENDOR:
|
|
2231
|
+
case this.RENDERER:
|
|
2232
|
+
case this.VERSION:
|
|
2233
|
+
case this.SHADING_LANGUAGE_VERSION: {
|
|
2234
|
+
const len = dv.getUint32(ptr - 16, true);
|
|
2235
|
+
const bytes = new Uint8Array(ex.memory.buffer, ptr, len);
|
|
2236
|
+
return new TextDecoder().decode(bytes);
|
|
2237
|
+
}
|
|
2263
2238
|
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
}
|
|
2239
|
+
case this.VIEWPORT:
|
|
2240
|
+
return new Int32Array(ex.memory.buffer.slice(ptr, ptr + 16));
|
|
2267
2241
|
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
}
|
|
2242
|
+
case this.COLOR_CLEAR_VALUE:
|
|
2243
|
+
return new Float32Array(ex.memory.buffer.slice(ptr, ptr + 16));
|
|
2271
2244
|
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2245
|
+
case this.COLOR_WRITEMASK: {
|
|
2246
|
+
const mem = new Uint8Array(ex.memory.buffer, ptr, 4);
|
|
2247
|
+
return [mem[0] !== 0, mem[1] !== 0, mem[2] !== 0, mem[3] !== 0];
|
|
2248
|
+
}
|
|
2275
2249
|
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2250
|
+
case this.DRAW_FRAMEBUFFER_BINDING:
|
|
2251
|
+
case this.READ_FRAMEBUFFER_BINDING: {
|
|
2252
|
+
const handle = dv.getInt32(ptr, true);
|
|
2253
|
+
if (handle === 0) return null;
|
|
2254
|
+
return this._fbHandles.get(handle) || null;
|
|
2255
|
+
}
|
|
2279
2256
|
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
0x8800, // STENCIL_BACK_FUNC
|
|
2286
|
-
0x8CA4, // STENCIL_BACK_VALUE_MASK
|
|
2287
|
-
0x8CA3, // STENCIL_BACK_REF
|
|
2288
|
-
0x0B94, // STENCIL_FAIL
|
|
2289
|
-
0x0B95, // STENCIL_PASS_DEPTH_FAIL
|
|
2290
|
-
0x0B96, // STENCIL_PASS_DEPTH_PASS
|
|
2291
|
-
0x8801, // STENCIL_BACK_FAIL
|
|
2292
|
-
0x8802, // STENCIL_BACK_PASS_DEPTH_FAIL
|
|
2293
|
-
0x8803, // STENCIL_BACK_PASS_DEPTH_PASS
|
|
2294
|
-
];
|
|
2257
|
+
case this.RENDERBUFFER_BINDING: {
|
|
2258
|
+
const handle = dv.getInt32(ptr, true);
|
|
2259
|
+
if (handle === 0) return null;
|
|
2260
|
+
return this._rbHandles.get(handle) || null;
|
|
2261
|
+
}
|
|
2295
2262
|
|
|
2296
|
-
|
|
2297
|
-
|
|
2263
|
+
case this.MAX_DRAW_BUFFERS:
|
|
2264
|
+
case this.MAX_COLOR_ATTACHMENTS:
|
|
2265
|
+
case this.MAX_VERTEX_ATTRIBS:
|
|
2266
|
+
case this.STENCIL_WRITEMASK:
|
|
2267
|
+
case this.STENCIL_BACK_WRITEMASK:
|
|
2268
|
+
case this.DEPTH_FUNC:
|
|
2269
|
+
case this.STENCIL_FUNC:
|
|
2270
|
+
case this.STENCIL_VALUE_MASK:
|
|
2271
|
+
case this.STENCIL_REF:
|
|
2272
|
+
case this.STENCIL_BACK_FUNC:
|
|
2273
|
+
case this.STENCIL_BACK_VALUE_MASK:
|
|
2274
|
+
case this.STENCIL_BACK_REF:
|
|
2275
|
+
case this.STENCIL_FAIL:
|
|
2276
|
+
case this.STENCIL_PASS_DEPTH_FAIL:
|
|
2277
|
+
case this.STENCIL_PASS_DEPTH_PASS:
|
|
2278
|
+
case this.STENCIL_BACK_FAIL:
|
|
2279
|
+
case this.STENCIL_BACK_PASS_DEPTH_FAIL:
|
|
2280
|
+
case this.STENCIL_BACK_PASS_DEPTH_PASS:
|
|
2281
|
+
return dv.getInt32(ptr, true);
|
|
2282
|
+
|
|
2283
|
+
case this.DEPTH_WRITEMASK:
|
|
2284
|
+
return dv.getUint8(ptr) !== 0;
|
|
2285
|
+
|
|
2286
|
+
default:
|
|
2287
|
+
if (pname >= this.DRAW_BUFFER0 && pname <= this.DRAW_BUFFER7) {
|
|
2288
|
+
return dv.getInt32(ptr, true);
|
|
2289
|
+
}
|
|
2298
2290
|
}
|
|
2299
2291
|
|
|
2300
2292
|
throw new Error(`getParameter for ${pname} not implemented`);
|
package/webgl2.debug.wasm
CHANGED
|
Binary file
|
package/webgl2.wasm
CHANGED
|
Binary file
|