6
6
7
7
This script makes it easier to debug WebGPU apps.
8
8
9
- note: this script is a work in progress. Pass encoder checking
10
- is barely implemented.
9
+ note: this script is a work in progress.
11
10
12
11
You can use it in your own projects via a script OR, you can
13
12
[ use it as an extension] ( https://github.com/greggman/webgpu-dev-extension ) .
@@ -22,11 +21,12 @@ to use this script version.
22
21
This is in contrast to normal WebGPU where errors are returned asynchronously
23
22
and so the command that caused the error is long forgotten.
24
23
25
- * It adds errors to command encoders and pass encoders
24
+ * It adds errors to command encoders and pass encoders (these throw)
26
25
27
26
In normal WebGPU, command encoders and pass encoders often do not report errors.
28
- Rather, they record the error, make the encoder as * invalid* , and then only report
29
- the error when the encoder is ended/finished. This can make it hard to find errors.
27
+ Rather, they record the error, mark the encoder as * invalid* , and then only report
28
+ the error when the encoder is ended/finished. This can make it hard to find errors
29
+ as they might have happened hundreds or thousands of calls ago.
30
30
31
31
With this script, many of these types of errors will be generated immediately.
32
32
51
51
import ' https://greggman.github.io/webgpu-debug-helper/dist/0.x/webgpu-debug-helper.js' ;
52
52
```
53
53
54
+ or
55
+
56
+ ``` html
57
+ <script type =" module" src =" https://greggman.github.io/webgpu-debug-helper/dist/0.x/webgpu-debug-helper.js" crossorigin >
58
+ ` ` `
59
+
54
60
There is nothing else to do. The webgpu-debug-helper will wrap the WebGPU API and
55
61
start generating error messages.
56
62
0 commit comments