diff --git a/.gitignore b/.gitignore index 1f1f743..0a6a9cf 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /docs /dist +/show-errors # -- clip-for-deploy-end -- diff --git a/README.md b/README.md index daea528..4c66828 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,14 @@ examples and inject the helper. Ideally there should be no errors. You can skip the first N tests with `-- --skip-count=` (the first `--` is required). +### show-errors.js + +You can generate show-errors.js with `npm run build-show-errors`. + +show-errors.js wraps calls to `pushErrorScope` and `popErrorScope` around every +method of `GPUDevice` and `GPUQueue`. It is used in the +[webgpu-dev-extension](https://github.com/greggman/webgpu-dev-extension). + ## License [MIT](LICENSE.md) diff --git a/tsconfig-show-errors.json b/tsconfig-show-errors.json new file mode 100644 index 0000000..3db4bb9 --- /dev/null +++ b/tsconfig-show-errors.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "AMD", + "outFile": "show-errors/show-errors.js", + "allowJs": true, + "declaration": false, + "typeRoots": [ + "./node_modules/@webgpu/types", + "./node_modules/@types", + ], + }, + + "include": [ + "src/error-scope-wrapper.ts", + ], + "typeAcquisition": { + "include": ["@webgpu/types"] + } +} \ No newline at end of file