Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: CI

jobs:
check_msrv:
name: Check MSRV (1.70.0)
name: Check MSRV (1.71.0)
strategy:
matrix:
include:
Expand All @@ -20,7 +20,7 @@ jobs:
- uses: dtolnay/rust-toolchain@nightly
- name: Generate lockfile with minimal dependency versions
run: cargo +nightly generate-lockfile -Zminimal-versions
- uses: dtolnay/rust-toolchain@1.70.0
- uses: dtolnay/rust-toolchain@1.71.0
# Note that examples are extempt from the MSRV check, so that they can use newer Rust features
- run: cargo check --workspace --features ${{ matrix.features }} --no-default-features

Expand Down
11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ homepage = "https://github.com/Traverse-Research/gpu-allocator"
repository = "https://github.com/Traverse-Research/gpu-allocator"
keywords = ["vulkan", "memory", "allocator"]
documentation = "https://docs.rs/gpu-allocator/"
rust-version = "1.70"
rust-version = "1.71"

include = [
"/README.md",
Expand All @@ -34,10 +34,11 @@ egui = { version = ">=0.24, <=0.27", optional = true, default-features = false }
egui_extras = { version = ">=0.24, <=0.27", optional = true, default-features = false }

[target.'cfg(target_vendor = "apple")'.dependencies]
objc2 = { version = "0.5.2", default-features = false, optional = true }
objc2-foundation = { version = "0.2", default-features = false, optional = true }
objc2-metal = { version = "0.2.1", default-features = false, features = [
objc2 = { version = "0.6", default-features = false, optional = true }
objc2-foundation = { version = "0.3", default-features = false, optional = true }
objc2-metal = { version = "0.3", default-features = false, features = [
"MTLAccelerationStructure",
"MTLAllocation",
"MTLBuffer",
"MTLDevice",
"MTLHeap",
Expand Down Expand Up @@ -76,7 +77,7 @@ features = [
]

[target.'cfg(target_vendor = "apple")'.dev-dependencies]
objc2-metal = { version = "0.2.1", default-features = false, features = [
objc2-metal = { version = "0.3", default-features = false, features = [
"MTLPixelFormat",
] }

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE-MIT)
[![LICENSE](https://img.shields.io/badge/license-apache-blue.svg?logo=apache)](LICENSE-APACHE)
[![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v1.4%20adopted-ff69b4.svg)](../main/CODE_OF_CONDUCT.md)
[![MSRV](https://img.shields.io/badge/rustc-1.70.0+-ab6000.svg)](https://blog.rust-lang.org/2023/06/01/Rust-1.70.0.html)
[![MSRV](https://img.shields.io/badge/rustc-1.71.0+-ab6000.svg)](https://blog.rust-lang.org/2023/07/13/Rust-1.71.0.html)

[![Banner](banner.png)](https://traverseresearch.nl)

Expand Down Expand Up @@ -169,7 +169,7 @@ allocator.free(&allocation).unwrap();

## Minimum Supported Rust Version

The MSRV for this crate and the `vulkan`, `d3d12` and `metal` features is Rust 1.70. Any other features such as the `visualizer` (with all the `egui` dependencies) may have a higher requirement and are not tested in our CI.
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.

## License

Expand Down
4 changes: 2 additions & 2 deletions README.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE-MIT)
[![LICENSE](https://img.shields.io/badge/license-apache-blue.svg?logo=apache)](LICENSE-APACHE)
[![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v1.4%20adopted-ff69b4.svg)](../main/CODE_OF_CONDUCT.md)
[![MSRV](https://img.shields.io/badge/rustc-1.70.0+-ab6000.svg)](https://blog.rust-lang.org/2023/06/01/Rust-1.70.0.html)
[![MSRV](https://img.shields.io/badge/rustc-1.71.0+-ab6000.svg)](https://blog.rust-lang.org/2023/07/13/Rust-1.71.0.html)

[![Banner](banner.png)](https://traverseresearch.nl)

Expand All @@ -21,7 +21,7 @@ gpu-allocator = "0.27.0"

## Minimum Supported Rust Version

The MSRV for this crate and the `vulkan`, `d3d12` and `metal` features is Rust 1.70. Any other features such as the `visualizer` (with all the `egui` dependencies) may have a higher requirement and are not tested in our CI.
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.

## License

Expand Down
4 changes: 1 addition & 3 deletions examples/metal-buffer.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use gpu_allocator::metal::{AllocationCreateDesc, Allocator, AllocatorCreateDesc};
use log::info;
use objc2::rc::Id;
use objc2_foundation::NSArray;
use objc2_metal::{
MTLCreateSystemDefaultDevice, MTLDevice as _, MTLHeap, MTLPixelFormat,
Expand All @@ -15,8 +14,7 @@ fn main() {
#[link(name = "CoreGraphics", kind = "framework")]
extern "C" {}

let device =
unsafe { Id::from_raw(MTLCreateSystemDefaultDevice()) }.expect("No MTLDevice found");
let device = MTLCreateSystemDefaultDevice().expect("No MTLDevice found");

// Setting up the allocator
let mut allocator = Allocator::new(&AllocatorCreateDesc {
Expand Down
8 changes: 2 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@
//! # #[cfg(feature = "metal")]
//! # fn main() {
//! use gpu_allocator::metal::*;
//! # use objc2::rc::Id;
//! # let device = unsafe { objc2_metal::MTLCreateSystemDefaultDevice() };
//! # let device = unsafe { Id::from_raw(device) }.expect("No MTLDevice found");
//! # let device = objc2_metal::MTLCreateSystemDefaultDevice().expect("No MTLDevice found");
//! let mut allocator = Allocator::new(&AllocatorCreateDesc {
//! device: device.clone(),
//! debug_settings: Default::default(),
Expand All @@ -181,9 +179,7 @@
//! # fn main() {
//! use gpu_allocator::metal::*;
//! use gpu_allocator::MemoryLocation;
//! # use objc2::rc::Id;
//! # let device = unsafe { objc2_metal::MTLCreateSystemDefaultDevice() };
//! # let device = unsafe { Id::from_raw(device) }.expect("No MTLDevice found");
//! # let device = objc2_metal::MTLCreateSystemDefaultDevice().expect("No MTLDevice found");
//! # let mut allocator = Allocator::new(&AllocatorCreateDesc {
//! # device: device.clone(),
//! # debug_settings: Default::default(),
Expand Down
4 changes: 2 additions & 2 deletions src/metal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ use crate::{

fn memory_location_to_metal(location: MemoryLocation) -> MTLResourceOptions {
match location {
MemoryLocation::GpuOnly => MTLResourceOptions::MTLResourceStorageModePrivate,
MemoryLocation::GpuOnly => MTLResourceOptions::StorageModePrivate,
MemoryLocation::CpuToGpu | MemoryLocation::GpuToCpu | MemoryLocation::Unknown => {
MTLResourceOptions::MTLResourceStorageModeShared
MTLResourceOptions::StorageModeShared
}
}
}
Expand Down