[CanvasKit] Cannot find WebGPU code in canvaskit.js

73 views
Skip to first unread message

남세현

unread,
May 21, 2024, 8:19:39 AMMay 21
to skia-discuss

While support for WebGPU like CanvasKit.MakeGPUDeviceContext() was added in 0.35.0, if you look at the actual build of canvaskit.js, the MakeGPUDeviceContext function cannot be found. It is present in index.d.ts though.

Does anyone happen to know about this issue?

Reference: 0.35.0 changelog - https://github.com/google/skia/blob/main/modules/canvaskit/CHANGELOG.md#0350---2022-06-30

Reference 2: The canvaskit.js file distributed on npm can be seen here, https://www.npmjs.com/package/canvaskit-wasm/v/0.39.1?activeTab=code

John Stiles

unread,
May 21, 2024, 8:27:42 AMMay 21
to skia-d...@googlegroups.com
Sorry, this was removed in M118. https://github.com/google/skia/blob/main/RELEASE_NOTES.md#milestone-118

> The Dawn backend for Ganesh has been removed. Dawn will continue to be supported in the Graphite backend.

Unfortunately, this change does impact CanvasKit, which is based on Ganesh.

Once Graphite is a more stable/mature API, we would ideally like to go back to CanvasKit and add Graphite support, but since Graphite is currently in active development, we aren't yet looking at building CanvasKit integrations for it. (To be fully transparent, there isn't anyone currently assigned to work on CanvasKit features full-time, but priorities shift all the time.)


--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/35bbd01a-76f2-4d70-a6f2-89c8e603d7c0n%40googlegroups.com.

남세현

unread,
May 21, 2024, 10:37:50 AMMay 21
to skia-discuss

> Once Graphite is a more stable/mature API, we would ideally like to go back to CanvasKit and add Graphite support, but since Graphite is currently in active development, we aren't yet looking at building CanvasKit integrations for it. (To be fully transparent, there isn't anyone currently assigned to work on CanvasKit features full-time, but priorities shift all the time.)  

Then, could working on adding Graphite support to CanvasKit be considered a good contribution to CanvasKit? I'm getting a bit interested in it. Although I don't have enough time myself, even if it's not me, it would be good if this is shared with the community as a good challenge.


2024년 5월 21일 화요일 오후 9시 27분 42초 UTC+9에 johns...@google.com님이 작성:

John Stiles

unread,
May 21, 2024, 10:39:07 AMMay 21
to skia-d...@googlegroups.com
It might be a significant undertaking, but certainly, any improvements to CanvasKit would be welcome as third-party submissions.

Greg Daniel

unread,
May 21, 2024, 10:52:46 AMMay 21
to skia-d...@googlegroups.com
Also note that you currently can just directly compile skia with wasm instead of going through the js CanvasKit interface.

남세현

unread,
May 29, 2024, 11:29:47 AMMay 29
to skia-discuss
> Also note that you currently can just directly compile skia with wasm instead of going through the js CanvasKit interface.

Following your suggestion, I built skia with wasm using the wasi-sdk and successfully ran skia with webgl2 in a wasm32-wasip1-threads environment in the web browser.
It looks like it's time to say goodbye to CanvasKit, haha.

2024년 5월 21일 화요일 오후 11시 52분 46초 UTC+9에 egda...@google.com님이 작성:
Reply all
Reply to author
Forward
0 new messages