visual-studioblazorwebassemblyemscriptenskiasharp

Skia sharp for blazor wasm with .net8 multithreading


I am having a blazor webassembly project which uses skia sharp for rendering images on canvas using SkiaSharp.Views.Blazor. I am compiling the project by enabling the multithread feature (Experimental) using <WasmEnableThreads>true</WasmEnableThreads>
but it fails with the error --shared-memory is disallowed by libskia.SkOpts.o because it was not compiled with atomics or bulk-memory features Btw all my drawings will going to take place on UI thread. I just want to use threads in other long running task. I also tried to compile the code by setting <EmccExtraLDFlags>--no-check-features</EmccExtraLDFlags> in project file but no luck. Any help would be appreciated.
Thanks


Solution

  • That sounds similar to this issue that has been fixed in SkiaSharp, just not included yet in a released version: https://github.com/mono/SkiaSharp/issues/2285