Wgpu

Latest version: v0.19.3

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

Scan your dependencies

Page 3 of 9

0.14.1

Added:

* The `wgpu.DiagnosticsBase` is now a public base class that can be subclassed by downstream libs (like pygfx) to provide diagnostics.

Changed:

* Diagnostics renders bools as `✓` or `-`, and large ints get scientific notation.

0.14.0

Added:

* The feature "float32-filterable" is now available natively.
* Add list of projects using wgpu-py to [README](README.mdprojects-using-wgpu-py). ([456](https://github.com/pygfx/wgpu-py/pull/456))

Changed:

* Updated to wgpu-native 0.19.1.1. ([458](https://github.com/pygfx/wgpu-py/pull/458))
* `Canvas.get_context()` now raises an error if no backend is selected yet (instead of returning a worthless base context object).
* Omitting the call to `context.get_current_texture()` results in a warning instead of an exception.

Removed:

* Shadertoy util is removed from the wgpu-py. It is now available as a separate package: [wgpu-shadertoy](https://github.com/pygfx/shadertoy). ([#455](https://github.com/pygfx/wgpu-py/pull/455))

Fixed:

* Devices no longer leak memory.

0.13.2

Added:

* Implement support for timestamp QuerySet.
* Add texture input and iFrameRate builtin to Shadertoy util https://github.com/pygfx/wgpu-py/pull/453

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.

Page 3 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.