dawn-python
ctypeslib based python bindings to the Dawn WebGPU engine with a focus on the compute pipeline. Besides the autogenerated bindings, a small utils interface (similar to wgpu-py) is provided to make it easier to run compute.
Chromium version used in pydawn: 133.0.6940.0
How to use
- Install from PyPI
pip install dawn-python
- Import utils, and webgpu
from pydawn import utils, webgpu
if __name__ == "__main__":
# Creating an adapter
adapter = utils.request_adapter_sync(power_preference=webgpu.WGPUPowerPreference_HighPerformance)
# Creating a device with a list of required features
dev = utils.request_device_sync(adapter, [webgpu.WGPUFeatureName_ShaderF16, webgpu.WGPUFeatureName_TimestampQuery])
For more details see examples/query_set.py
Generating bindings
- Build dawn or use the pre-built lib in the repo
pip install ctypeslib2clang2py -l libwebgpu_dawn.dylib webgpu.h --nm nm_patch.py -o webgpu.py
Examples
python3 examples/simple_compute.py
Supported platforms
- MacOS (arch: x86_64, arm64, optimal backend: Metal)
- Ubuntu (arch: x86_64, optimal backend: Vulkan)
- Windows (arch: x86_64, optimal backend: DirectX)
License
BSD 3-Clause, please see LICENSE
Metadata
Release files for dawn-python 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dawn_python-0.3.0.tar.gz | 19.1 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dawn_python-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.3 MB
Release files / dawn_python-0.3.0.tar.gz
| Download URL | dawn_python-0.3.0.tar.gz |
|---|---|
| Size | 19.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9950e6902d47513732981f92a98ff235d2269b3cb7bd6da8dbeb3e21b104c5e4
|
|
BLAKE2b-256 checksum How to use checksums |
0e4a1d9f130149dadcd95900911d6b457680cde265244ac73420e9262aa8ac04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / dawn_python-0.3.0-py3-none-any.whl
| Download URL | dawn_python-0.3.0-py3-none-any.whl |
|---|---|
| Size | 19.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
27b2878d60dc7c461f86283ec86981e781efec9f464b688c33aebd842e0854cc
|
|
BLAKE2b-256 checksum How to use checksums |
716079521bc4b9154d5c8521f462b67c0edc5a45e3387b3b8efa4e1666426296
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|