Issue 12512 in skia: Explore using WebGPU with CanvasKit

435 views
Skip to first unread message

kjlub… via monorail

unread,
Oct 8, 2021, 11:39:41 AM10/8/21
to bu...@skia.org
Status: Accepted
Owner: kjlu...@google.com
CC: bsalo...@google.com
Area: CanvasKit
Priority: Medium
Type: Feature

New issue 12512 by kjlu...@google.com: Explore using WebGPU with CanvasKit
https://bugs.chromium.org/p/skia/issues/detail?id=12512

We would like to have CanvasKit backed by WebGPU.

There is probably a fair amount of work to make sure the Dawn backend for Skia is compatible with whatever emscripten does to make the connection.

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Git Watcher via monorail

unread,
Oct 8, 2021, 12:36:08 PM10/8/21
to bu...@skia.org

Comment #1 on issue 12512 by Git Watcher: Explore using WebGPU with CanvasKit
https://bugs.chromium.org/p/skia/issues/detail?id=12512#c1

The following revision refers to this bug:
https://skia.googlesource.com/skia/+/68365c757921344872d01a3f326a27fb9e42d77e

commit 68365c757921344872d01a3f326a27fb9e42d77e
Author: Kevin Lubick <kjlu...@google.com>
Date: Fri Oct 08 15:39:50 2021

[demos] Add WebGPU demo using origin trial

Before we get too excited, this does not use CanvasKit.

What this does add is an origin-trial token so we can
more easily demo our progress on *.skia.org and test
locally using localhost:8123 (which is the default
if you run make local in //demos.skia.org)

To view this locally, I started chrome (stable 94) with
--enable-features=Vulkan --enable-unsafe-webgpu

Enabling the Vulkan was the advice of
https://web.dev/gpu/#browser-support
The second flag make sure the whole stack also uses Vulkan.

Change-Id: Ia1838352a46387b0b79e353601a32c859f6911c1
Bug: skia:12512
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457316
Reviewed-by: Brian Salomon <bsal...@google.com>

[add] https://crrev.com/68365c757921344872d01a3f326a27fb9e42d77e/demos.skia.org/demos/webgpu/index.html

kjlub… via monorail

unread,
Oct 21, 2021, 11:00:05 AM10/21/21
to bu...@skia.org
Updates:
Blockedon: 12541

Comment #2 on issue 12512 by kjlu...@google.com: Explore using WebGPU with CanvasKit
https://bugs.chromium.org/p/skia/issues/detail?id=12512#c2

Further exploration of WebGPU is blocked by paying down some technical debt.

The next goal would be to compile our GMs against WebGPU and be able to test them. We currently can compile our GMs for WebGL, but this is painful to do due to slow compile/link times as a result of the single-threaded nature of compile_gm.sh [1], which is just a result of a bash script not being the right tool to compile something as complex as Skia in an efficient way (it's not GN or Bazel).

Because WebGPU is newer and it will likely take a lot of iteration to get CanvasKit support for it and because I don't want to have to wait 5 minutes to rebuild every time I make a change, we need to address the slow build times first.

The right way to do this is to remove compile.sh and compile_gm.sh and replace them with a proper build system. While this could be done in GN, I would prefer to not have to work hard on GN files/toolchains, just to migrate them to Bazel, as that seems to be the trend of Skia's build system.

I've already done a POC build of a simple WebGPU application using Bazel + Emscripten [2].

Therefore, I am going to hold off on further WebGPU exploration until we can build the GM test suite in WASM using Bazel, so future work is less agonizingly slow.

[1] https://github.com/google/skia/blob/05ac1b86adbb2534242e3d78745a848a12f28603/modules/canvaskit/compile_gm.sh#L216
[2] https://github.com/google/skia/tree/f08ebb15f043090c3b0b0161065e0070f7073e87/experimental/webgpu-bazel

kjlub… via monorail

unread,
Nov 8, 2021, 9:23:41 AM11/8/21
to bu...@skia.org

Comment #3 on issue 12512 by kjlu...@google.com: Explore using WebGPU with CanvasKit
https://bugs.chromium.org/p/skia/issues/detail?id=12512#c3

Update: The Bazel build of the GMs (with the WebGL backend) is much much faster than compile_gm.sh, especially for incremental builds. 10s of minutes down to 10s of seconds.

This will be well worth the detour.

Git Watcher via monorail

unread,
Mar 7, 2022, 9:39:11 AM3/7/22
to bu...@skia.org

Comment #4 on issue 12512 by Git Watcher: Explore using WebGPU with CanvasKit
https://bugs.chromium.org/p/skia/issues/detail?id=12512#c4


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b

commit 7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b
Author: Kevin Lubick <kjlu...@google.com>
Date: Mon Mar 07 14:00:50 2022

[dawn] Clean up include paths and dawn_native namespace

Change-Id: I343d878b2ff3b1abf52007c7612b01c53731566b
Bug: dawn:824,dawn:1275,skia:12512
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516916
Reviewed-by: Greg Daniel <egda...@google.com>
Commit-Queue: Kevin Lubick <kjlu...@google.com>

[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/src/gpu/dawn/GrDawnProgramBuilder.h
[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/tools/sk_app/DawnWindowContext.cpp
[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/tools/sk_app/DawnWindowContext.h
[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/src/gpu/dawn/GrDawnGpu.h
[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/include/gpu/dawn/GrDawnTypes.h
[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/tools/sk_app/win/DawnD3D12WindowContext_win.cpp
[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/tools/gpu/dawn/DawnTestContext.h
[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/tools/sk_app/unix/WindowContextFactory_unix.h
[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/tools/gpu/dawn/DawnTestContext.cpp
[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/tools/sk_app/unix/DawnVulkanWindowContext_unix.cpp
[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/src/gpu/dawn/GrDawnProgramDataManager.h
[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/tools/sk_app/mac/DawnMTLWindowContext_mac.mm
[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/src/gpu/dawn/GrDawnUtil.h
[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/src/gpu/dawn/GrDawnBuffer.h
[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/include/gpu/GrBackendSurface.h
[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/src/gpu/dawn/GrDawnAttachment.h
[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/src/gpu/dawn/GrDawnTexture.h
[modify] https://crrev.com/7d4e12544e2d5ffcb1015e1adc2b15cd7f80a76b/src/gpu/dawn/GrDawnOpsRenderPass.h

arman… via monorail

unread,
Apr 15, 2022, 6:50:28 PM4/15/22
to bu...@skia.org
Updates:
Cc: arma...@google.com

Comment #5 on issue 12512 by arma...@google.com: Explore using WebGPU with CanvasKit
https://bugs.chromium.org/p/skia/issues/detail?id=12512#c5

(No comment was entered for this change.)

Git Watcher via monorail

unread,
Apr 29, 2022, 1:03:06 PM4/29/22
to bu...@skia.org

Comment #6 on issue 12512 by Git Watcher: Explore using WebGPU with CanvasKit
https://bugs.chromium.org/p/skia/issues/detail?id=12512#c6


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/0c3dda058c2bebfd958f8af6da146c2f81bd3358

commit 0c3dda058c2bebfd958f8af6da146c2f81bd3358
Author: Arman Uguray <arma...@google.com>
Date: Fri Apr 15 22:58:16 2022

[ganesh][dawn] Support blocking on async WebGPU events in WASM

The `wgpu::Device::Tick()` function is not available when the Dawn
backend is compiled using emsdk to target WebAssembly. As an
alternative, this CL introduces code that takes advantage of
emscripten's Asyncify feature to yield execution to the browser's event
loop and allowing it to execute async tasks from blocking Skia code.

* Introduced the GrDawnAsyncWait class which abstracts over Asyncify vs
wgpu::Device::Tick depending on the platform and implements common
busy-wait boilerplate.
* Refactored the fence management in GrDawnGpu to make use of
GrDawnAsyncWait. The GPUQueue.onSubmittedWorkDone is now handled by a
callback on GrDawnGpu instead of per-fence callbacks since the latter
cannot easily prevent a use-after-free if a fence is destroyed before
the callback runs.

Bug: skia:12512
Change-Id: I255e92ec87c799dc7a50bd034a815c0aaca0ef5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/530736
Reviewed-by: Kevin Lubick <kjlu...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

[modify] https://crrev.com/0c3dda058c2bebfd958f8af6da146c2f81bd3358/src/gpu/ganesh/BUILD.bazel
[modify] https://crrev.com/0c3dda058c2bebfd958f8af6da146c2f81bd3358/src/gpu/ganesh/dawn/GrDawnGpu.h
[add] https://crrev.com/0c3dda058c2bebfd958f8af6da146c2f81bd3358/src/gpu/ganesh/dawn/GrDawnAsyncWait.h
[modify] https://crrev.com/0c3dda058c2bebfd958f8af6da146c2f81bd3358/src/gpu/ganesh/dawn/BUILD.bazel
[add] https://crrev.com/0c3dda058c2bebfd958f8af6da146c2f81bd3358/src/gpu/ganesh/dawn/GrDawnAsyncWait.cpp
[modify] https://crrev.com/0c3dda058c2bebfd958f8af6da146c2f81bd3358/gn/gpu.gni
[modify] https://crrev.com/0c3dda058c2bebfd958f8af6da146c2f81bd3358/src/gpu/ganesh/dawn/GrDawnGpu.cpp

Git Watcher via monorail

unread,
Apr 29, 2022, 5:08:27 PM4/29/22
to bu...@skia.org

Comment #7 on issue 12512 by Git Watcher: Explore using WebGPU with CanvasKit
https://bugs.chromium.org/p/skia/issues/detail?id=12512#c7


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/8cfcfaecb6b2435910f11e0295111ad37b883c10

commit 8cfcfaecb6b2435910f11e0295111ad37b883c10
Author: Arman Uguray <arma...@google.com>
Date: Sat Apr 16 16:52:12 2022

[experimental] Update WebGPU/Bazel demo

* Made several changes to the Bazel rules to work around an issue with
the Closure compiler and Asyncify and a WASM code-size issue on debug
builds.

* The native draw code now invokes Skia using the Dawn backend. The
example uses `SkSurface::flushAndSubmit` and Emscripten's Asyncify
feature to synchronize animation frames with the underlying WebGPU
command queue completion.

* Cosmetic changes to the HTML with CSS and an animation loop that
alternates the canvas color between cyan and magenta every second.

Bug: skia:12512
Change-Id: I9888bbec89c2fb01676898ffe4a7071d8690611e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/530856

Reviewed-by: Kevin Lubick <kjlu...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

Git Watcher via monorail

unread,
Apr 29, 2022, 5:43:07 PM4/29/22
to bu...@skia.org

Comment #8 on issue 12512 by Git Watcher: Explore using WebGPU with CanvasKit
https://bugs.chromium.org/p/skia/issues/detail?id=12512#c8


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/7bc99709417e1559f9eaebd4484d9fdc16f7e4df

commit 7bc99709417e1559f9eaebd4484d9fdc16f7e4df
Author: Arman Uguray <arma...@google.com>
Date: Thu Apr 21 17:40:39 2022

[experimental] Add runtime effects to WebGPU demo

Added a radial gradient and a RuntimeEffect to the WebGPU demo.
Both of these exercise shader creation and staging buffer allocation.

Also refactored the C++ code to reuse a GrDirectContext which highly
improves the per-frame performance when using runtime effects. However
this unfortunately triggers skbug.com/13266 so a work-around has been
provided in which the context can conditionally get re-created every
frame, as before.

Bug: skia:12512

Change-Id: Ic3e71679bf449bd8557577f74001f18e300e952a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534756
Reviewed-by: Kevin Lubick <kjlu...@google.com>
Reviewed-by: Brian Osman <brian...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

[modify] https://crrev.com/7bc99709417e1559f9eaebd4484d9fdc16f7e4df/experimental/webgpu-bazel/example/index.html
[modify] https://crrev.com/7bc99709417e1559f9eaebd4484d9fdc16f7e4df/experimental/webgpu-bazel/src/bindings.cpp

Git Watcher via monorail

unread,
May 2, 2022, 1:21:11 PM5/2/22
to bu...@skia.org

Comment #9 on issue 12512 by Git Watcher: Explore using WebGPU with CanvasKit
https://bugs.chromium.org/p/skia/issues/detail?id=12512#c9


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/c908c3a898895e5d0afa785e60c6867092766a79

commit c908c3a898895e5d0afa785e60c6867092766a79
Author: Arman Uguray <arma...@google.com>
Date: Fri Apr 22 21:17:23 2022

[ganesh][dawn] Better handle buffer mapAsync failures

GrDawnGpu tries to guarantee the CPU mapping invariants of GrDawnBuffer
objects that are managed by a GrStagingBufferManager by issuing and
tracking mapAsync requests following command buffer submission. However,
this logic suffered from some issues where:

1. The code always assumed mapAsync succeeds. If a mapAsync request
failed during shutdown due to a lost GPU connection, the GrDawnGpu
destructor would spin forever waiting for pending mapAsync requests
to complete.
2. If a client unmapped and then re-mapped a buffer that isn't managed
by the async staging buffer logic in GrDawnGpu, the buffer would
never get mapped and likely hit an assertion for a non-staging
buffer.

These are now fixed:

* GrDawnBuffer now has more explicit error handling to make it more
tolerant to mapAsync failures.
* GrGpuBuffer now relies on mapAsync completion callbacks instead of
spinning on `GrGpuBuffer::isMapped` as a buffer may never get mapped
in the case of an error. This also has the benefit of tracking the
mapAsync procedure state on a per-request basis intead of relying on
state stored in GrDawnBuffer. The existing `fBusyStagingBuffers` has
been replaced by a single reference counted `GrDawnAsyncWait` object.
* A synchronous/blocking map function has been provided to satisfy the
`GrGpuBuffer::onMap` contract. This method is not used in the existing
staging buffer use cases in practice but it solves part of problem #2
above.
* GrDawnGpu::onReadPixels now uses a GrDawnBuffer's blocking map
functionality using the public GrGpuBuffer API. This has the same
behavior as the existing blocking map that created and mapped a
wgpu::Buffer directly.
* The invariants around GrDawnBuffer lifetime and CPU mapping are
documented in class level comments.

Bug: skia:12512

Change-Id: I8bb92137fbd60c31066e4071bd696018b3563bb8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/533758
Reviewed-by: Greg Daniel <egda...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

[modify] https://crrev.com/c908c3a898895e5d0afa785e60c6867092766a79/src/gpu/ganesh/dawn/GrDawnBuffer.cpp
[modify] https://crrev.com/c908c3a898895e5d0afa785e60c6867092766a79/src/gpu/ganesh/dawn/GrDawnGpu.h
[modify] https://crrev.com/c908c3a898895e5d0afa785e60c6867092766a79/src/gpu/ganesh/dawn/GrDawnAsyncWait.h
[modify] https://crrev.com/c908c3a898895e5d0afa785e60c6867092766a79/src/gpu/ganesh/dawn/GrDawnBuffer.h
[modify] https://crrev.com/c908c3a898895e5d0afa785e60c6867092766a79/src/gpu/ganesh/dawn/BUILD.bazel
[modify] https://crrev.com/c908c3a898895e5d0afa785e60c6867092766a79/src/gpu/ganesh/dawn/GrDawnGpu.cpp
[modify] https://crrev.com/c908c3a898895e5d0afa785e60c6867092766a79/tests/TextureProxyTest.cpp

arman… via monorail

unread,
Jun 16, 2022, 6:31:28 PM6/16/22
to bu...@skia.org
Updates:
Cc: -arma...@google.com kjlu...@google.com brian...@google.com
Owner: arma...@google.com

Comment #10 on issue 12512 by arma...@google.com: Explore using WebGPU with CanvasKit
https://bugs.chromium.org/p/skia/issues/detail?id=12512#c10

I have the initial round of API additions up for review here: https://skia-review.googlesource.com/c/skia/+/550327. I'm assigning this bug to myself as I'm currently driving it forward. My plan is to get an initial implementation of my proposed API functions working and available for testing. There will be a long tail of incremental CanvasKit API changes and additions to work better with WebGPU and my plan is to document and inform that future work following this initial milestone.

Git Watcher via monorail

unread,
Jun 16, 2022, 7:15:06 PM6/16/22
to bu...@skia.org

Comment #11 on issue 12512 by Git Watcher: Explore using WebGPU with CanvasKit
https://bugs.chromium.org/p/skia/issues/detail?id=12512#c11


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/c0271d8db1ef44c881445c5560758b60658e9bbe

commit c0271d8db1ef44c881445c5560758b60658e9bbe
Author: Arman Uguray <arma...@google.com>
Date: Sat Jun 11 07:14:36 2022

[canvaskit] Enable WebGPU in GN build

* Skia GN can now build the Dawn backend without depending on Dawn
native, provided that webgpu_cpp.h/webgpu_cpp.cpp is provided by
emscripten.
* Split gpu.js into webgl.js and webgpu.js. None of the CanvasKit API
functions are wired up to WebGPU yet so it will use the CPU renderer.
* Added new macros and GN args to distinguish between WebGPU and WebGL
builds in CanvasKit, instead of relying on Skia GN args.
* Renamed CANVASKIT_NO_ALIAS_FONT macro to CK_NO_ALIAS_FONT to match
style.

Bug: skia:12512
Change-Id: Ifc4191da046bd7af73492cfba6e3ca530590d722
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548603
Reviewed-by: Kevin Lubick <kjlu...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

[modify] https://crrev.com/c0271d8db1ef44c881445c5560758b60658e9bbe/modules/canvaskit/BUILD.gn
[modify] https://crrev.com/c0271d8db1ef44c881445c5560758b60658e9bbe/modules/canvaskit/debugger_bindings.cpp
[add] https://crrev.com/c0271d8db1ef44c881445c5560758b60658e9bbe/modules/canvaskit/webgpu.js
[modify] https://crrev.com/c0271d8db1ef44c881445c5560758b60658e9bbe/modules/canvaskit/canvaskit.gni
[modify] https://crrev.com/c0271d8db1ef44c881445c5560758b60658e9bbe/modules/canvaskit/BUILD.bazel
[rename] https://crrev.com/c0271d8db1ef44c881445c5560758b60658e9bbe/modules/canvaskit/webgl.js
[modify] https://crrev.com/c0271d8db1ef44c881445c5560758b60658e9bbe/modules/canvaskit/Makefile
[modify] https://crrev.com/c0271d8db1ef44c881445c5560758b60658e9bbe/modules/canvaskit/compile_gm.sh
[modify] https://crrev.com/c0271d8db1ef44c881445c5560758b60658e9bbe/gn/skia.gni
[modify] https://crrev.com/c0271d8db1ef44c881445c5560758b60658e9bbe/modules/canvaskit/compile.sh
[modify] https://crrev.com/c0271d8db1ef44c881445c5560758b60658e9bbe/BUILD.gn
[modify] https://crrev.com/c0271d8db1ef44c881445c5560758b60658e9bbe/modules/canvaskit/cpu.js
[modify] https://crrev.com/c0271d8db1ef44c881445c5560758b60658e9bbe/modules/canvaskit/canvaskit_bindings.cpp

arman… via monorail

unread,
Jun 29, 2022, 5:35:19 PM6/29/22
to bu...@skia.org

Comment #14 on issue 12512 by arma...@google.com: Explore using WebGPU with CanvasKit
https://bugs.chromium.org/p/skia/issues/detail?id=12512#c14

It looks like I used the wrong bug number in a number of CLs. I'm going to repost them here for completeness.

arman… via monorail

unread,
Jun 29, 2022, 5:35:27 PM6/29/22
to bu...@skia.org

Comment #15 on issue 12512 by arma...@google.com: Explore using WebGPU with CanvasKit
https://bugs.chromium.org/p/skia/issues/detail?id=12512#c15


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/61b36e126410ba88d770cfc7bd872b8fabfc63b9

commit 61b36e126410ba88d770cfc7bd872b8fabfc63b9
Author: Arman Uguray <arma...@google.com>
Date: Wed Jun 15 17:24:18 2022

[ganesh][dawn] Fix bazel WASM build

Dawn headers and symbols for WASM are provided by emscripten and a
direct dependency on Dawn native leads to conflicts in those builds.
Fixed the ganesh/dawn Bazel rules to only depend on Dawn on non-wasm
builds.

Bug: skia:13427
Change-Id: Ie1fa0b2c1a6486b4db3a9adb2366645c9c8c5e7e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550257

Reviewed-by: Kevin Lubick <kjlu...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

arman… via monorail

unread,
Jun 29, 2022, 5:35:58 PM6/29/22
to bu...@skia.org

Comment #16 on issue 12512 by arma...@google.com: Explore using WebGPU with CanvasKit
https://bugs.chromium.org/p/skia/issues/detail?id=12512#c16


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/b1b818896c9b6839ae009c7d661b2646370bd140

commit b1b818896c9b6839ae009c7d661b2646370bd140
Author: Arman Uguray <arma...@google.com>
Date: Mon Jun 27 18:00:47 2022

[canvaskit] Implement WebGPU API methods for surface creation

* The native backend exposes a variant of _MakeGrContext that creates a
GrDirectContext backed by a Dawn wgpu::Device.
* The native backend currently exposes a single API function,
"_MakeGPUTextureSurface" which returns a SkSurface from Dawn backend
render target over a Dawn wgpu::Texture. This function can be used to
draw to any WebGPU texture, including offscreen textures or to a
canvas swapchain texture.
* The MakeGPUDeviceContext, MakeGPUCanvasContext, MakeGPUCanvasSurface
functions are implemented purely in JavaScript.
* The CanvasKit.webgpu property can be used to detect whether WebGPU
support has been compiled in.

Bug: skia:13427
Change-Id: I953f24ca58389d5989a108685abbc02e56d4e18b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553636
Reviewed-by: Brian Salomon <bsal...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

[modify] https://crrev.com/b1b818896c9b6839ae009c7d661b2646370bd140/modules/canvaskit/BUILD.gn
[modify] https://crrev.com/b1b818896c9b6839ae009c7d661b2646370bd140/modules/canvaskit/externs.js
[modify] https://crrev.com/b1b818896c9b6839ae009c7d661b2646370bd140/modules/canvaskit/interface.js
[modify] https://crrev.com/b1b818896c9b6839ae009c7d661b2646370bd140/modules/canvaskit/webgpu.js
[modify] https://crrev.com/b1b818896c9b6839ae009c7d661b2646370bd140/modules/canvaskit/webgl.js
[modify] https://crrev.com/b1b818896c9b6839ae009c7d661b2646370bd140/modules/canvaskit/canvaskit_bindings.cpp

arman… via monorail

unread,
Jun 29, 2022, 5:36:19 PM6/29/22
to bu...@skia.org

Comment #17 on issue 12512 by arma...@google.com: Explore using WebGPU with CanvasKit
https://bugs.chromium.org/p/skia/issues/detail?id=12512#c17


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/dd9d54d2c2bfa332808ee96654e591915927cfb5

commit dd9d54d2c2bfa332808ee96654e591915927cfb5
Author: Arman Uguray <arma...@google.com>
Date: Mon Jun 27 20:36:41 2022

[canvaskit] Use WebGPU in npm_build/example.html

Several canvases in the npm_build/example.html demo now use WebGPU if it
is supported by the browser and the CanvasKit build in use.

The examples have been refactored to support both WebGPU and non-WebGPU
mode of usage. Two examples that currently rely on Surface.drawOnce
don't work correctly on WebGPU as the API call may draw to the wrong
swapchain texture ("paths" and "pathperson") and will benefit from a
`WebGPUCanvasContext.drawOnce` function.

Bug: skia:13427
Change-Id: I16dc06a9788cf78e86b2097f44c1f83ca0b2315a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553637

Reviewed-by: Brian Salomon <bsal...@google.com>
Commit-Queue: Arman Uguray <arma...@google.com>

arman… via monorail

unread,
Jun 29, 2022, 5:36:48 PM6/29/22
to bu...@skia.org

Git Watcher via monorail

unread,
Jun 30, 2022, 7:06:04 AM6/30/22
to bu...@skia.org

Comment #19 on issue 12512 by Git Watcher: Explore using WebGPU with CanvasKit
https://bugs.chromium.org/p/skia/issues/detail?id=12512#c19


The following revision refers to this bug:
https://skia.googlesource.com/skia/+/49f89eafefcf113df75df2c432bbc79a61a60440

commit 49f89eafefcf113df75df2c432bbc79a61a60440
Author: Arman Uguray <arma...@google.com>
Date: Wed Jun 29 21:22:35 2022

[canvaskit] Update CHANGELOG on WebGPU support

Bug: skia:12512
Change-Id: I0e49d44615af5c44b9eff4be96b77b51cf6a789c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554693
Reviewed-by: Kevin Lubick <kjlu...@google.com>

[modify] https://crrev.com/49f89eafefcf113df75df2c432bbc79a61a60440/modules/canvaskit/CHANGELOG.md
Reply all
Reply to author
Forward
0 new messages