66
77This script makes it easier to debug WebGPU apps.
88
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.
1110
1211You can use it in your own projects via a script OR, you can
1312[ use it as an extension] ( https://github.com/greggman/webgpu-dev-extension ) .
@@ -22,11 +21,12 @@ to use this script version.
2221 This is in contrast to normal WebGPU where errors are returned asynchronously
2322 and so the command that caused the error is long forgotten.
2423
25- * It adds errors to command encoders and pass encoders
24+ * It adds errors to command encoders and pass encoders (these throw)
2625
2726 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.
3030
3131 With this script, many of these types of errors will be generated immediately.
3232
5151import ' https://greggman.github.io/webgpu-debug-helper/dist/0.x/webgpu-debug-helper.js' ;
5252```
5353
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+
5460There is nothing else to do. The webgpu-debug-helper will wrap the WebGPU API and
5561start generating error messages.
5662
0 commit comments