Pygfx

Latest version: v0.9.0

Safety actively analyzes 723158 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 10

0.13.1

Fixed:

* Prevent access violation errors with GLFW on Windows.
* Prevent a segfault when deleting a `GPUPipelineLayout` (observed in a very specific use-case on LavaPipe).
* Fix `triangle_glsl.py` example.
* Fix that when logger is set to debug, errors are produced when Python exits.

Added:

* Support for linux-aarch64 (binary wheels available)! This includes Raspberry Pi's with a 64-bit OS, and adds support for building linux docker images on Apple Silicon devices without having to emulate x86 (no need for `--platform linux/amd64`).

0.13.0

Added:

* Add `iDate` builtin to Shadertoy utility.
* Allow "auto" layout args for `create_compute_pipeline()`.
* Official support for Python 3.12 and pypy.

Changed:

* Update to wgpu-native 0.18.1.2.
* `CanvasContext.get_current_texture()` now returns a `GPUTexture` instead of a `GPUTextureView`.
* `OffscreenCanvasBase.present()` now receives a `GPUTexture` instead of a `GPUTextureView`,
and this is a new texture on each draw (no re-use).
* Renamed ``wgpu.gui.WgpuOffscreenCanvas` to `WgpuOffscreenCanvasBase`.
* The `wgpu.base` submodule that defined the GPU classes is renamed to be a private
module. The new `wgpu.classes` namespace contains all GPU classes (and nothing else).
* The `__repr__` of the GPU classes shows a shorter canonical class name.
* Flags and Enums have a more useful `__repr__`.

Fixed:

* Dragging a window between windows with different scale factor (with Qt on Windows)
no longer puts the window in an invalid state. A warning is still produced though.
* `GPUCommandEncoder.begin_render_pass()` binds the lifetime of passed texture views to
the returned render pass object to prevent premature destruction when no reference to
a texture view is kept.

0.12.0

This is a big release that contains many improvements, but also multiple API changes.

Most backward incompatible changes are due to two things: the backend
system has been refactored, making it simpler and future-proof. And we
have revised the buffer mapping API, making it more similar to the
WebGPU spec, and providing more flexible and performant ways to set
buffer data.

A summary to help you update your code:
py
X import wgpu.backends.rs
import wgpu


X wgpu.request_adapter(canvas=None, power_preference="high-performance")
wgpu.gpu.request_adapter(power_preference="high-performance")

X buffer.map_read()
buffer.map("READ")
buffer.read_mapped(...)
buffer.read_mapped(...)
buffer.unmap()

X buffer.map_write()
buffer.map("WRITE")
buffer.write_mapped(data1, ...)
buffer.write_mapped(data2, ...)
buffer.unmap()


Added:

* The `wgpu.gpu` object, which represents the API entrypoint. This makes the API more clear and more similar to the WebGPU API.
* A convenience `auto` backend, and a stub `js_webgpu` backend.
* New function `enumerate_adapters()` in the `wgpu_native` backend.
* Warning about pip when wgpu-native binary is missing on Linux
* The `GPUBuffer` has new methods `map()`, `map_async()`, `unmap()`. These have been
part of the WebGPU spec for a long time, but we had an alternative API, until now.
* The `GPUBuffer` has new methods `read_mapped()` and `write_mapped()`. These are not
present in the WebGPU spec; they are the Pythonic alternative to `getMappedRange()`.
* Flags can now be passed as strings, and can even be combined using "MAP_READ|COPY_DIST".
* GUI events have an extra "timestamp" field, and wheel events an additional "buttons" field.
* A diagnostics subsystem that amongst other things counts GPU objects. Try e.g. `wgpu.diagnostics.print_report()`.
* Several improvements to the shadertoy util: offscreen support and a snapshot method.

Changed:

* Can create a buffer that is initially mapped: `device.create_buffer(..., mapped_at_creation=True)` is enabled again.
* The `wgpu.request_adapter()` function is moved to `wgpu.gpu.request_adapter()`. Same for the async version.
* The `canvas` argument of the `request_adapter()` function is now optional.
* The `rs` backend is renamed to `wgpu_native`.
* It is no longer necessary to explicitly import the backend.
* The `GPUDevice.request_device_tracing()` method is now a function in the `wgpu_native` backend.
* We no longer force using Vulkan on Windows. For now wgpu-native still prefers Vulkan over D3D12.
* The `wgpu.utils` subpackage is imported by default, but most submodules are not. This means that `compute_with_buffers` must be explicitly imported from `wgpu.utils.compute`.

Deprecated:

* `wgpu.request_adapter()` and its async version. Use `wgpu.gpu.request_adapter()` instead.
* The `GPUBuffer` methods `map_read()`and `map_write()` are deprecated, in favor of `map()`, `unmap()`, `read_mapped()` and `write_mapped()`.

To be clear, these are not changed:

* The convenient `device.create_buffer_with_data()` (not part of the WebGPU spec) is still available.
* The `GPUQueue.read_buffer()` and `GPUQueue.write_buffer()` methods are unchanged.

Fixed:

* The shaderutil now re-uses the default device, avoiding memoryleaks when running multiple consecutively.
* The GUI backend selection takes into account whether a backend module is already imported.
* The offscreen GUI backend no longer uses asyncio (it does not need an event loop).
* Prevent a few classes of memoryleaks. Mind that creating many `GPUDevice` objects still leaks.

0.11.0

Changed:

* Update to wgpu-native 0.17.2.1. No changes are needed in downstream code.

0.10.0

In this release the API is aligned with the latest webgpu.idl, and
we updated to wgpu-native (v0.17.0.2).

Added:

* New `wgpu.wgsl_language_features` property, which for now always returns an empty set.
* The `GPUShaderModule.compilation_info` property (and its async version) are replaced with a `get_compilation_info()` method.
* The WebGPU features "bgra8unorm-storage" and "float32-filterable" are now available.

Changed:

* The binary wheels are now based on manylinux 2.28, and the 32bit Linux wheels are no longer built.
* In WGSL: toplevel constants must be defined using `const`, using `let` will now fail.
* In WGSL: it is no longer possible to re-declare an existing variable name.
* Error messages may look a bit different, since wgpu-native now produces nice messages replacing our custom ones.
* Errors produced by a call into a wgpu-native function now produce a Python exception (no more async logging of errors).

0.9.5

Fixed:

* Fixed setting the dpi awareness in the Qt backend, by correctly looking up the Qt version.

Changed:

* Links to readthedocs now point to *stable* instead of *latest*, so that people
reading the docs see these that reflect the latest release.
* Don't enable any features by default (previously WGPUNativeFeature_TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES was enabled).

Page 4 of 10

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.