You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-1
Original file line number
Diff line number
Diff line change
@@ -142,6 +142,7 @@ let mut allocator = Allocator::new(&AllocatorCreateDesc {
142
142
```
143
143
144
144
## Simple Metal allocation example
145
+
145
146
```rust
146
147
usegpu_allocator::metal::*;
147
148
usegpu_allocator::MemoryLocation;
@@ -167,9 +168,39 @@ drop(resource);
167
168
allocator.free(&allocation).unwrap();
168
169
```
169
170
171
+
## `no_std` Support
172
+
173
+
`no_std` support can be enabled by compiling with `--no-default-features` to
174
+
disable `std` support and `--features hashbrown` for `Hash` collections that are only
175
+
defined in `std` for internal usages in crate. For example:
176
+
177
+
```toml
178
+
[dependencies]
179
+
gpu-allocator = { version = "0.27", default-features = false, features = ["hashbrown", "other features"] }
180
+
```
181
+
182
+
To support both `std` and `no_std` builds in project, you can use the following
183
+
in your `Cargo.toml`:
184
+
185
+
```toml
186
+
[features]
187
+
default = ["std", "other features"]
188
+
189
+
std = ["gpu-allocator/std"]
190
+
hashbrown = ["gpu-allocator/hashbrown"]
191
+
other_features = []
192
+
193
+
[dependencies]
194
+
gpu-allocator = { version = "0.27", default-features = false }
195
+
```
196
+
170
197
## Minimum Supported Rust Version
171
198
172
-
The MSRV for this crate and the `vulkan`, `d3d12` and `metal` features is Rust 1.71. Any other features such as the `visualizer` (with all the `egui` dependencies) may have a higher requirement and are not tested in our CI.
199
+
The MSRV for this crate and the `vulkan`, `d3d12` and `metal` features is Rust **1.71**.
200
+
201
+
The `no_std` support requires version above **1.81** beacuase `no_std` support of dependency `thiserror` requires `core::error::Error` which is stabalized in **1.81**.
202
+
203
+
Any other features such as the `visualizer` (with all the `egui` dependencies) may have a higher requirement and are not tested in our CI.
Copy file name to clipboardExpand all lines: README.tpl
+31-1
Original file line number
Diff line number
Diff line change
@@ -19,9 +19,39 @@ gpu-allocator = "0.27.0"
19
19
20
20
{{readme}}
21
21
22
+
## `no_std` Support
23
+
24
+
`no_std` support can be enabled by compiling with `--no-default-features` to
25
+
disable `std` support and `--features hashbrown` for `Hash` collections that are only
26
+
defined in `std` for internal usages in crate. For example:
27
+
28
+
```toml
29
+
[dependencies]
30
+
gpu-allocator = { version = "0.27", default-features = false, features = ["hashbrown", "other features"] }
31
+
```
32
+
33
+
To support both `std` and `no_std` builds in project, you can use the following
34
+
in your `Cargo.toml`:
35
+
36
+
```toml
37
+
[features]
38
+
default = ["std", "other features"]
39
+
40
+
std = ["gpu-allocator/std"]
41
+
hashbrown = ["gpu-allocator/hashbrown"]
42
+
other_features = []
43
+
44
+
[dependencies]
45
+
gpu-allocator = { version = "0.27", default-features = false}
46
+
```
47
+
22
48
## Minimum Supported Rust Version
23
49
24
-
The MSRV for this crate and the `vulkan`, `d3d12` and `metal` features is Rust 1.71. Any other features such as the `visualizer` (with all the `egui` dependencies) may have a higher requirement and are not tested in our CI.
50
+
The MSRV for this crate and the `vulkan`, `d3d12` and `metal` features is Rust **1.71**.
51
+
52
+
The `no_std` support requires version above **1.81** beacuase `no_std` support of dependency `thiserror` requires `core::error::Error` which is stabalized in **1.81**.
53
+
54
+
Any other features such as the `visualizer` (with all the `egui` dependencies) may have a higher requirement and are not tested in our CI.
0 commit comments