How to use dawn backend.

83 views
Skip to first unread message

Block Micro

unread,
Jan 26, 2024, 2:17:10 PMJan 26
to skia-discuss
I'm a bit confused about the graphite dawn backend. After building skia with graphite and dawn build option on, it seems that there's already a dawn_native packed in skia.lib. The question is how can I use the dawn_native in it to create a context associated with glfw window?

Currently I've tried to use the dawn's headers and directly link with skia.lib(without linking to libdawn_native) and with webgpu_glfw for the glfw functionalities. However, things went wrong. I got a text validation failure which says:

[graphite] ** ERROR ** validate_backend_texture failed: backendTex.info = Dawn(format=0x00000017,usage=0x00000010,sampleCount=1,mipmapped=0,protected=0); colorType = 4

Besides, when building Debug builds, constructing skgpu::graphite::BackendTexture with WGPUTexture clears the whole stack, making everything 0, which is supreme weird.

Is there any simple example projects that's constructed with skia graphite, dawn and glfw that I can learn from? Any help'll be appreciated.


Block Micro

unread,
Jan 28, 2024, 11:08:49 AMJan 28
to skia-discuss
any idea?

Jim Van Verth

unread,
Jan 29, 2024, 9:57:10 AMJan 29
to skia-d...@googlegroups.com
There are no examples with GLFW, but there are some in tools/window that show how to set up Dawn with various backend types (Metal, Vulkan, and D3D12).

--
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/1f1b0914-1694-4a87-b73e-c1eef7d21276n%40googlegroups.com.


--

Jim Van Verth |
 Software Engineer | Google.com

Block Micro

unread,
Feb 6, 2024, 1:25:50 AMFeb 6
to skia-discuss
> Besides, when building Debug builds, constructing skgpu::graphite::BackendTexture with WGPUTexture clears the whole stack, making everything 0, which is supremely weird.

I eventually figured this out. It's caused by the header mismatch. When compiling skia, as both Vulkan and Dawn backends are enabled, the size of BackendTexture is 100 bytes, but when compiling my own app, the size of it is only 64 bytes.

The debug process is here: https://t.me/microblock_pub/176
在2024年1月27日星期六 UTC+8 03:17:10<Block Micro> 写道:
Reply all
Reply to author
Forward
0 new messages