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
`no_std` support can be enabled by compiling with `--no-default-features` to disable `std` support and `--features hashbrown` for `Hash` collections that are only defined in `std` for internal usages in crate. For example:
```toml
[dependencies]
gpu-allocator = { version = "0.27.0", default-features = false, features = ["hashbrown", "other features"] }
```
Co-authored-by: Marijn Suijten <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,6 +136,7 @@ let mut allocator = Allocator::new(&AllocatorCreateDesc {
136
136
```
137
137
138
138
## Simple Metal allocation example
139
+
139
140
```rust
140
141
usegpu_allocator::metal::*;
141
142
usegpu_allocator::MemoryLocation;
@@ -161,9 +162,36 @@ drop(resource);
161
162
allocator.free(&allocation).unwrap();
162
163
```
163
164
165
+
## `no_std` support
166
+
167
+
`no_std` support can be enabled by compiling with `--no-default-features` to disable `std` support and `--features hashbrown` for `Hash` collections that are only defined in `std` for internal usages in crate. For example:
168
+
169
+
```toml
170
+
[dependencies]
171
+
gpu-allocator = { version = "0.27.0", default-features = false, features = ["hashbrown", "other features"] }
172
+
```
173
+
174
+
To support both `std` and `no_std` builds in your project, use the following in your `Cargo.toml`:
175
+
176
+
```toml
177
+
[features]
178
+
default = ["std", "other features"]
179
+
180
+
std = ["gpu-allocator/std"]
181
+
hashbrown = ["gpu-allocator/hashbrown"]
182
+
other_features = []
183
+
184
+
[dependencies]
185
+
gpu-allocator = { version = "0.27.0", default-features = false }
186
+
```
187
+
164
188
## Minimum Supported Rust Version
165
189
166
-
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.
190
+
The MSRV for this crate and the `vulkan`, `d3d12` and `metal` features is Rust **1.71**.
191
+
192
+
The `no_std` support requires Rust **1.81** or higher because `no_std` support of dependency `thiserror` requires `core::error::Error` which is stabilized in **1.81**.
193
+
194
+
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
+28-1Lines changed: 28 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -19,9 +19,36 @@ 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 disable `std` support and `--features hashbrown` for `Hash` collections that are only defined in `std` for internal usages in crate. For example:
25
+
26
+
```toml
27
+
[dependencies]
28
+
gpu-allocator = { version = "0.27.0", default-features = false, features = ["hashbrown", "other features"] }
29
+
```
30
+
31
+
To support both `std` and `no_std` builds in your project, use the following in your `Cargo.toml`:
32
+
33
+
```toml
34
+
[features]
35
+
default = ["std", "other features"]
36
+
37
+
std = ["gpu-allocator/std"]
38
+
hashbrown = ["gpu-allocator/hashbrown"]
39
+
other_features = []
40
+
41
+
[dependencies]
42
+
gpu-allocator = { version = "0.27.0", default-features = false}
43
+
```
44
+
22
45
## Minimum Supported Rust Version
23
46
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.
47
+
The MSRV for this crate and the `vulkan`, `d3d12` and `metal` features is Rust **1.71**.
48
+
49
+
The `no_std` support requires Rust **1.81** or higher because `no_std` support of dependency `thiserror` requires `core::error::Error` which is stabilized in **1.81**.
50
+
51
+
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