| [emscripten] Use Emscripten diagnostics.error instead of raise Makes errors show up as more nicely-formatted Emscripten error messages, instead of as stack traces. Also finally start documenting what bits of Emscripten we depend on. Bug: none Change-Id: I6f104db70dd65804f63aa170f52f8c7b056b77b5 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/264636 Auto-Submit: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Loko Kung <lokokung@google.com> Commit-Queue: Kai Ninomiya <kainino@chromium.org> | 9 个月前 |
| [dawn][headers] Removes additional underscore for internal struct. - Replaces WGPUINTERNAL__HAVE_EMDAWNWEBGPU_HEADER with WGPUINTERNAL_HAVE_EMDAWNWEBGPU_HEADER to comply with -Wreserved-identifier. Bug: 354162571 Change-Id: Ib0e45a975c39135b88e0b96ee7be6021cdb1cd51 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/221856 Commit-Queue: Kai Ninomiya <kainino@chromium.org> Auto-Submit: Loko Kung <lokokung@google.com> Reviewed-by: Kai Ninomiya <kainino@chromium.org> | 1 年前 |
| [emscripten] Build Emdawnwebgpu tests on GN This should test Emdawnwebgpu build/link on CQ. To build the bindings and tests locally, build 'emdawnwebgpu'. - Add GN rules for tests (skipping InitOnlySample which is just for manually testing code size). - Make top-level BUILD.gn rules build these tests when dawn_wasm (not is_wasm) is true, so they build whenever Emscripten is available. Using is_wasm at the top level would only work if the the default toolchain were Emscripten, but that isn't allowed. - Don't bother to run the few generation targets without Emscripten, that was only so they would run on CQ before we had Emscripten toolchain support. - Fix warnings that the GN build catches. - Unrelated autoformat in //BUILD.gn (dxc:dxc -> dxc). Verified the tests run locally in debug and release builds. Verified that the link test builds on CQ by dry running with a missing symbol in the JS file: https://dawn-review.googlesource.com/c/dawn/+/266016/3?checksPatchset=3&tab=checks https://ci.chromium.org/ui/p/dawn/builders/try/dawn-cq-mac-x64-rel/331/overview Bug: 450959456, 417823381 Change-Id: I902a3620b702cd0f07e862393f0ee949c191b78b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/266016 Reviewed-by: Loko Kung <lokokung@google.com> Auto-Submit: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Kai Ninomiya <kainino@chromium.org> | 8 个月前 |
| [emscripten] Enable building with Closure Compiler when possible We want to always build with Closure because it provides static analysis checks that will catch some bugs in the bindings. However, Mac bots can't run Closure (it requires either Rosetta 2 or Java), so detect this situation and disable Closure in that case in GN. Bug: 450959456 Change-Id: I423b8506e5636f215574312d3155327b3be6a298 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/266194 Commit-Queue: Kai Ninomiya <kainino@chromium.org> Auto-Submit: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Loko Kung <lokokung@google.com> | 8 个月前 |
| [emscripten] Fix dependency on copied header The Emscripten CMake build has been broken (since https://dawn-review.googlesource.com/c/dawn/+/270194). This fixes it. It also seems to avoid the problem of never having a no-op build due to emdawnwebgpu_headers_gen not knowing when its POST_BUILD step is stale. (Note we previously reverted just the Emscripten roll, to unblock something, but it's actually been broken on 4.0.14 too, and as a result Emdawnwebgpu releases have not been going out.) Tested working on clean builds on both 4.0.14 and 4.0.20. Fixed: 456628846 Change-Id: If5c9496c4a5685d96a442e43273e6903dd492938 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/276939 Reviewed-by: Fr <beaufort.francois@gmail.com> Auto-Submit: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Kai Ninomiya <kainino@chromium.org> | 7 个月前 |
| [emscripten] Add code size test script And a second code size test for testing dead code elimination. Produces output like this: Type , File , Size , Gzip , Brotli Debug , emdawnwebgpu_init_only.js , 103861 , 28197 , 24169 Release , emdawnwebgpu_init_only.js , 9038 , 4090 , 3627 MinSizeRel , emdawnwebgpu_init_only.js , 9038 , 4090 , 3629 Debug , emdawnwebgpu_init_only.wasm , 2573142 , 569846 , 433061 Release , emdawnwebgpu_init_only.wasm , 24031 , 9468 , 7908 MinSizeRel , emdawnwebgpu_init_only.wasm , 22738 , 9290 , 7892 Debug , emdawnwebgpu_link_test.js , 169877 , 37549 , 31579 Release , emdawnwebgpu_link_test.js , 30874 , 10954 , 9572 MinSizeRel , emdawnwebgpu_link_test.js , 30874 , 10960 , 9577 Debug , emdawnwebgpu_link_test.wasm , 2710280 , 581164 , 436289 Release , emdawnwebgpu_link_test.wasm , 40268 , 14751 , 12048 MinSizeRel , emdawnwebgpu_link_test.wasm , 38676 , 14623 , 12119 Bug: 377760848 Change-Id: I3d882df0fcb6c6819f9b0205e59d0b9c8ba1930d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/255560 Reviewed-by: Loko Kung <lokokung@google.com> Commit-Queue: Kai Ninomiya <kainino@chromium.org> | 11 个月前 |
| Adds Shrek to Emscripten OWNERS file. Change-Id: Ice4c6376c92ddc361c19dd76d2db53e59d83c644 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/200116 Reviewed-by: Shrek Shao <shrekshao@google.com> Auto-Submit: Loko Kung <lokokung@google.com> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Loko Kung <lokokung@google.com> Commit-Queue: Kai Ninomiya <kainino@chromium.org> | 1 年前 |
| [emscripten] Audit and fix makeGetValue calls - Fix some size_t and objects to be loaded as '*' - Fix some integers loaded with the wrong size or sign - Load all enums with 'i32' not 'u32' (not important, just consistency) - Make convertSentinelToUndefined take a type to be more error-resistant - Remove now-unused i53abi from emwgpuWaitAny - A few comments and small code simplifications - Also remove unused "binding-not-used" entries from the enum tables Bug: none, 448993920 Change-Id: Ifa989b082fe86e760b07426beb9d82132ed176ea Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/265037 Commit-Queue: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Loko Kung <lokokung@google.com> | 8 个月前 |
| Generate files to use Emscripten bindings from outside Emscripten We are stabilizing webgpu.h, and that process requires many (mostly small) breaking changes to the header. Right now, some projects are relying on Emscripten's and Dawn's implementations of webgpu.h to be in sync, but this creates challenges because we need to make many separate breaking changes. This change forks Emscripten's WebGPU bindings into Dawn (in //third_party) in such a way that they don't have to be checked into the Emscripten repository. This way we can keep Dawn's bindings and Dawn's fork of the Emscripten bindings in sync (approximately) in the Dawn repository. Projects depending on Emscripten and Dawn to be in sync should use this fork instead, until we've finished the webgpu.h changes and contributed the bindings back up to Emscripten in one big breaking release that should have minimal to no breakage afterward. For ease of diffing this commit overwrites the verbatim copies of library_{,html5_}webgpu.js added in the previous commit, with a few updates to bring it in sync with Dawn (though it may not be fully in sync - it has only been minimally tested so far). Example of using the resulting generated files from outside GN: https://github.com/kainino0x/webgpu-cross-platform-demo/compare/dawnwasm The generated files can only be generated using the GN build; CMake rules haven't been implemented, and the existing Emscripten build rules for CMake have been removed. Note, since these bindings were designed to live inside Emscripten, they rely on some Emscripten internals. Symbols in rough order from less stable to more stable: - $stackSave - changed recently - $stackRestore - changed recently - $callUserCallback - $stringToUTF8OnStack - $stringToNewUTF8 - $stringToUTF8 - $lengthBytesUTF8 - $readI53FromI64 - $findCanvasEventTarget - $warnOnce Generator internals, these seem stable: - mergeInto - C_STRUCTS - LibraryManager.library The build rules also depend on: - the location of gen_struct_info.py (which recently changed from tools/ to tools/maint/) Bug: 346806934 Change-Id: I6ca10ea37bc7307d4d9571dcdc696e7d025663d3 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/193722 Reviewed-by: Loko Kung <lokokung@google.com> Auto-Submit: Kai Ninomiya <kainino@chromium.org> Reviewed-by: dan sinclair <dsinclair@chromium.org> Commit-Queue: dan sinclair <dsinclair@chromium.org> | 1 年前 |
| [emscripten] Add code size test script And a second code size test for testing dead code elimination. Produces output like this: Type , File , Size , Gzip , Brotli Debug , emdawnwebgpu_init_only.js , 103861 , 28197 , 24169 Release , emdawnwebgpu_init_only.js , 9038 , 4090 , 3627 MinSizeRel , emdawnwebgpu_init_only.js , 9038 , 4090 , 3629 Debug , emdawnwebgpu_init_only.wasm , 2573142 , 569846 , 433061 Release , emdawnwebgpu_init_only.wasm , 24031 , 9468 , 7908 MinSizeRel , emdawnwebgpu_init_only.wasm , 22738 , 9290 , 7892 Debug , emdawnwebgpu_link_test.js , 169877 , 37549 , 31579 Release , emdawnwebgpu_link_test.js , 30874 , 10954 , 9572 MinSizeRel , emdawnwebgpu_link_test.js , 30874 , 10960 , 9577 Debug , emdawnwebgpu_link_test.wasm , 2710280 , 581164 , 436289 Release , emdawnwebgpu_link_test.wasm , 40268 , 14751 , 12048 MinSizeRel , emdawnwebgpu_link_test.wasm , 38676 , 14623 , 12119 Bug: 377760848 Change-Id: I3d882df0fcb6c6819f9b0205e59d0b9c8ba1930d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/255560 Reviewed-by: Loko Kung <lokokung@google.com> Commit-Queue: Kai Ninomiya <kainino@chromium.org> | 11 个月前 |