This commit was authored by running the following Nushell script, using the `nu` binary and the lovely `fastmod` tool: ```nushell # Copy-pasted from the OP in [`gpuweb`#4838](https://github.com/gpuweb/gpuweb/pull/4838). let renames_table = ' Type Old New Used in dict GPUImageDataLayout GPUTexelCopyBufferLayout "writeTexture, parent type of ↙" dict GPUImageCopyBuffer "GPUTexelCopyBufferInfo extends ↑" T2B, B2T dict GPUImageCopyTexture GPUTexelCopyTextureInfo T2B, B2T, T2T, writeTexture dict GPUImageCopyTextureTagged "GPUCopyExternalImageDestInfo extends ↑" copyExternalImageToTexture dict GPUImageCopyExternalImage GPUCopyExternalImageSourceInfo copyExternalImageToTexture union GPUImageCopyExternalImageSource GPUCopyExternalImageSource member of ↖ ' let renames_table = $renames_table | from tsv | select 'Old ' 'New ' | rename old new | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier | update old { strip_gpu_prefix | str trim } | update new { strip_gpu_prefix | str trim } | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments) def strip_gpu_prefix []: string -> string { $in | str replace --regex '^GPU' '' } # Rename image APIs. for entry in $renames_table { fastmod --accept-all --fixed-strings $entry.old $entry.new --iglob '!CHANGELOG.md' --iglob "!xtask/src/vendor_web_sys.rs" --iglob '!wgpu/src/backend/webgpu/webgpu_sys/' --iglob '!deno_webgpu/' --iglob '!wgpu/src/backend/webgpu.rs' } cargo fmt ``` …and cleaning up `deno_webgpu/`'s Rust compilation errors.
deno_webgpu
This op crate implements the WebGPU API as defined in https://gpuweb.github.io/gpuweb/ in Deno. The implementation targets the spec draft as of March 31, 2024. The spec is still very much in flux. This extension tries to stay up to date with the spec, but is constrained by the features implemented in our GPU backend library wgpu.
The spec is still very bare bones, and is still missing many details. As the spec becomes more concrete, we will implement to follow the spec more closely.
In addition, setting the DENO_WEBGPU_TRACE environmental variable will output
a
wgpu trace
to the specified directory.
For testing this op crate will make use of the WebGPU conformance tests suite, running through our WPT runner. This will be used to validate implementation conformance.
GitHub CI doesn't run with GPUs, so testing relies on software like DX WARP & Vulkan lavapipe. Currently, only using DX WARP works, so tests are only run on Windows.
Links
Specification: https://gpuweb.github.io/gpuweb/
Design documents: https://github.com/gpuweb/gpuweb/tree/main/design
Conformance tests suite: https://github.com/gpuweb/cts
WebGPU examples for Deno: https://github.com/crowlKats/webgpu-examples
wgpu-users matrix channel: https://matrix.to/#/#wgpu-users:matrix.org