Skip to content

Commit fb90cd5

Browse files
authored
Bump version to 0.12.0 (#414)
* Bump version to 0.12.0 * Update for canvas arg
1 parent a88bd70 commit fb90cd5

File tree

3 files changed

+61
-30
lines changed

3 files changed

+61
-30
lines changed

CHANGELOG.md

Lines changed: 58 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# Changelog / release notes
22

3-
WGPU and WebGPU are still changing fast, and with that we do to. We dont
3+
WebGPU and wgpu-native are still changing fast, and with that we do to. We do
44
not yet attempt to make things backwards compatible. Instead we try to
55
be precise about tracking changes to the public API.
66

77
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
99

10-
1110
Possible sections in each release:
1211

1312
* Added: for new features.
@@ -18,56 +17,88 @@ Possible sections in each release:
1817
* Security: in case of vulnerabilities.
1918

2019

21-
### [v0.12.0] - tbd
20+
### [v0.12.0] - 15-11-2023
2221

23-
Changed:
24-
25-
* The `wgpu.request_adapter()` is moved to `wgpu.gpu.request_adapter()`. Same for the async version.
26-
This puts all API entrypoint stuff on the `wgpu.gpu` object, which also better reflects the WebGPU api.
27-
* The `rs` backend is renamed to `wgpu_native`.
28-
* It is no longer necessary to explicitly import the backend.
29-
* The `GPUDevice.request_device_tracing()` method is now a function in the `wgpu_native` backend.
30-
31-
Added:
32-
33-
* Convenience `auto` backend.
34-
* Stub `js_webgpu` backend.
35-
* New function `enumerate_adapters()` in the `wgpu_native` backend.
22+
This is a big release that contains many improvements, but also multiple API changes.
3623

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

38-
### [v0.11.0] - 11-10-2023
30+
A summary to help you update your code:
31+
```py
32+
# X import wgpu.backends.rs
33+
import wgpu
3934

40-
Changed:
4135

42-
* Update to wgpu-native 0.17.2.1. No changes are needed in downstream code.
36+
# X wgpu.request_adapter(canvas=None, power_preference="high-performance")
37+
wgpu.gpu.request_adapter(power_preference="high-performance")
4338

39+
# X buffer.map_read()
40+
buffer.map("READ")
41+
buffer.read_mapped(...)
42+
buffer.read_mapped(...)
43+
buffer.unmap()
4444

45-
### [v0.11.0] - t.b.d.
46-
47-
We have revised the buffer mapping API, making it more similar to the
48-
WebGPU spec, and providing more flexible and performant ways to set
49-
buffer data.
45+
# X buffer.map_write()
46+
buffer.map("WRITE")
47+
buffer.write_mapped(data1, ...)
48+
buffer.write_mapped(data2, ...)
49+
buffer.unmap()
50+
```
5051

5152
Added:
5253

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

5867
Changed:
5968

6069
* Can create a buffer that is initially mapped: `device.create_buffer(..., mapped_at_creation=True)` is enabled again.
70+
* The `wgpu.request_adapter()` function is moved to `wgpu.gpu.request_adapter()`. Same for the async version.
71+
* The `canvas` argument of the `request_adapter()` function is now optional.
72+
* The `rs` backend is renamed to `wgpu_native`.
73+
* It is no longer necessary to explicitly import the backend.
74+
* The `GPUDevice.request_device_tracing()` method is now a function in the `wgpu_native` backend.
75+
* We no longer force using Vulkan on Windows. For now wgpu-native still prefers Vulkan over D3D12.
76+
* 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`.
6177

62-
Removed:
78+
Deprecated:
6379

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

66-
For the record, these are not changed:
83+
To be clear, these are not changed:
6784

68-
* The convenient `device.create_buffer_with_data()` (not part of the WebGPU spec) is also available.
85+
* The convenient `device.create_buffer_with_data()` (not part of the WebGPU spec) is still available.
6986
* The `GPUQueue.read_buffer()` and `GPUQueue.write_buffer()` methods are unchanged.
7087

88+
Fixed:
89+
90+
* The shaderutil now re-uses the default device, avoiding memoryleaks when running multiple consecutively.
91+
* The GUI backend selection takes into account whether a backend module is already imported.
92+
* The offscreen GUI backend no longer uses asyncio (it does not need an event loop).
93+
* Prevent a few classes of memoryleaks. Mind that creating many `GPUDevice` objects still leaks.
94+
95+
96+
### [v0.11.0] - 11-10-2023
97+
98+
Changed:
99+
100+
* Update to wgpu-native 0.17.2.1. No changes are needed in downstream code.
101+
71102

72103
### [v0.10.0] - 09-10-2023
73104

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ def finalize_options(self):
2828
else:
2929
pass # don't include binaries; user will have to arrange for the lib
3030

31-
runtime_deps = ["cffi>=1.15.0rc2", "rubicon-objc>=0.4.1; sys_platform == 'darwin'"]
31+
runtime_deps = ["cffi>=1.15.0", "rubicon-objc>=0.4.1; sys_platform == 'darwin'"]
3232
extra_deps = {
33-
"jupyter": ["jupyter_rfb>=0.3.1"],
33+
"jupyter": ["jupyter_rfb>=0.4.2"],
3434
"glfw": ["glfw>=1.9"],
3535
"docs": ["sphinx>7.2", "sphinx_rtd_theme"],
3636
}

wgpu/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from . import resources # noqa: F401,F403
1414

1515

16-
__version__ = "0.11.0"
16+
__version__ = "0.12.0"
1717
version_info = tuple(map(int, __version__.split(".")))
1818

1919

0 commit comments

Comments
 (0)