Go to file
Arman Uguray 0c3dda058c [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 <kjlubick@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
2022-04-29 17:02:12 +00:00
bazel [includes] Enforce IWYU on //example 2022-04-29 15:39:33 +00:00
bench [includes] Enforce IWYU on src/utils 2022-04-28 17:32:20 +00:00
bin Handle 'aarch64' from platform.machine() 2022-03-01 13:10:59 +00:00
build/fuchsia [fuchsia] Fix fidlc command. 2020-06-10 03:29:24 +00:00
build_overrides Set dawn_vulkan_tools_dir in Dawn's GN overrides 2022-04-14 17:05:33 +00:00
client_utils/android Revert "Move SkCamera.h to client_utils/android" 2022-04-25 12:33:01 +00:00
demos.skia.org [canvaskit] Add in fillText to spreadsheet demo for comparison 2022-02-15 15:35:43 +00:00
dm Add optional OT-SVG support to FreeType 2022-04-25 18:51:01 +00:00
docker [infra] Avoid timeouts in CreateDockerImage_Skia_WASM_Release 2022-04-08 12:26:54 +00:00
docs/examples Reland "Add kR8_unorm_SkColorType" 2022-02-10 18:00:19 +00:00
example [includes] Enforce IWYU on //example 2022-04-29 15:39:33 +00:00
experimental Finish GrMipMapped->GrMipmapped 2022-04-15 15:43:52 +00:00
fuzz [includes] Enforce IWYU on src/utils 2022-04-28 17:32:20 +00:00
gm Fix -Wunused-but-set-variable warnings 2022-04-29 15:20:59 +00:00
gn [ganesh][dawn] Support blocking on async WebGPU events in WASM 2022-04-29 17:02:12 +00:00
include Reland "[includes] Remove SkColorSpace include from SkImageInfo" 2022-04-29 14:56:15 +00:00
infra Update to newer LLVM for Windows builds 2022-04-29 16:22:29 +00:00
modules Fix -Wunused-but-set-variable warnings 2022-04-29 15:20:59 +00:00
platform_tools Enable required Android API levels for SkQP test cases. 2022-04-27 21:00:34 +00:00
resources Move recursion tests into general /errors/ directory. 2022-04-28 21:25:41 +00:00
samplecode [includes] Enforce IWYU on src/utils 2022-04-28 17:32:20 +00:00
site [bazel] Add initial docs for bazel use (and .bazelrc tips) 2022-04-28 20:48:21 +00:00
specs [infra] Port serve.py from Python2 to 3 2021-08-31 15:28:19 +00:00
src [ganesh][dawn] Support blocking on async WebGPU events in WASM 2022-04-29 17:02:12 +00:00
tests Fix -Wunused-but-set-variable warnings 2022-04-29 15:20:59 +00:00
third_party [bazel] Point to vk_mem_alloc from DEPS 2022-04-29 12:45:56 +00:00
toolchain [includes] Enforce IWYU on src/utils 2022-04-28 17:32:20 +00:00
tools Reland "[includes] Remove SkColorSpace include from SkImageInfo" 2022-04-29 14:56:15 +00:00
.bazelrc [sksl] Make sksl tracing optional 2022-04-12 13:59:25 +00:00
.bazelversion [canvaskit] Add skottie to Bazel build 2022-02-04 19:18:27 +00:00
.clang-format no more bin packing in .clang-format 2021-03-04 17:22:50 +00:00
.clang-tidy Disable ClangTidy namespace comments for short blocks. 2020-08-24 14:01:22 +00:00
.gitignore Add .vscode to the default gitignore list. 2021-10-13 15:23:02 +00:00
.gn Add support for ANGLE's Metal backend 2022-04-28 19:53:18 +00:00
.vpython [python3] Reland recipes -> python3 changes 2021-12-01 13:04:03 +00:00
AUTHORS Add missing include for std::begin and std::end in SkParseColor.cpp 2022-04-26 17:39:59 +00:00
BUILD.bazel [bazel] Move skcms and vulkanmemoryalloctor to subdirs 2022-04-21 12:15:50 +00:00
BUILD.gn Revert "Move SkCamera.h to client_utils/android" 2022-04-25 12:33:01 +00:00
codereview.settings
CONTRIBUTING
CQ_COMMITTERS
DEPS Roll SwiftShader from b92f7acb7e81 to adef92e7b4c6 (4 revisions) 2022-04-29 08:14:28 +00:00
DIR_METADATA Move metadata in OWNERS files to DIR_METADATA files 2021-02-02 23:41:54 +00:00
go_repositories.bzl [infra] Update dep of infra repo 2022-04-28 13:20:10 +00:00
go.mod [infra] Update dep of infra repo 2022-04-28 13:20:10 +00:00
go.sum [infra] Fix go.sum 2022-04-28 18:01:34 +00:00
LICENSE
OWNERS [infra] Add wildcard OWNERS 2021-08-30 19:19:34 +00:00
OWNERS.android Update OWNERS.android with more details 2022-03-16 18:13:33 +00:00
package-lock.json [bazel] Make custom karma_test rule 2022-02-23 14:53:01 +00:00
package.json [bazel] Make custom karma_test rule 2022-02-23 14:53:01 +00:00
PRESUBMIT.py [bazel] Add RBE support using hermetic Linux Clang toolchain 2022-03-28 13:56:16 +00:00
public.bzl Revert "Remove wasm from public.bzl" 2022-04-26 17:28:24 +00:00
README
README.chromium
RELEASE_NOTES.txt Revert "Reland "Add anisotropic option to SkSamplingOptions."" 2022-04-29 14:35:04 +00:00
requirements.txt add Mac hash for MarkupSafe requirements 2022-04-13 15:39:27 +00:00
whitespace.txt Push shaders.skia.org. 2022-01-19 21:46:16 +00:00
WORKSPACE.bazel [bazel] Point to vk_mem_alloc from DEPS 2022-04-29 12:45:56 +00:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.