From ddbdcdfe577aad71f0d4ed27d006e65ad72f2874 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Tue, 16 May 2023 13:39:00 +0200 Subject: [PATCH] Fix examples and improve README after #168 merge (#169) The CI isn't holding back PR merges, and some nitty API changes behind feature toggles slipped through the cracks. --- README.md | 2 +- examples/d3d12-buffer.rs | 5 +++-- examples/d3d12-visualization/main.rs | 3 ++- src/lib.rs | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e3fbffce..cc67d1f6 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ unsafe { device.destroy_buffer(buffer, None) }; use gpu_allocator::d3d12::*; let mut allocator = Allocator::new(&AllocatorCreateDesc { - device, + device: ID3D12DeviceVersion::Device(device), debug_settings: Default::default(), allocation_sizes: Default::default(), }); diff --git a/examples/d3d12-buffer.rs b/examples/d3d12-buffer.rs index bd9ff2df..73c5f8b6 100644 --- a/examples/d3d12-buffer.rs +++ b/examples/d3d12-buffer.rs @@ -10,7 +10,8 @@ mod all_dxgi { use log::*; use gpu_allocator::d3d12::{ - AllocationCreateDesc, Allocator, AllocatorCreateDesc, ResourceCategory, ToWinapi, ToWindows, + AllocationCreateDesc, Allocator, AllocatorCreateDesc, ID3D12DeviceVersion, ResourceCategory, + ToWinapi, ToWindows, }; use gpu_allocator::MemoryLocation; @@ -117,7 +118,7 @@ fn main() { // Setting up the allocator let mut allocator = Allocator::new(&AllocatorCreateDesc { - device: device.as_windows().clone(), + device: ID3D12DeviceVersion::Device(device.as_windows().clone()), debug_settings: Default::default(), allocation_sizes: Default::default(), }) diff --git a/examples/d3d12-visualization/main.rs b/examples/d3d12-visualization/main.rs index a364a786..5107850e 100644 --- a/examples/d3d12-visualization/main.rs +++ b/examples/d3d12-visualization/main.rs @@ -1,5 +1,6 @@ #![windows_subsystem = "windows"] //! Example showcasing [`winapi`] interop with [`gpu-allocator`] which is driven by the [`windows`] crate. +use gpu_allocator::d3d12::ID3D12DeviceVersion; use log::info; use raw_window_handle::HasRawWindowHandle; @@ -356,7 +357,7 @@ fn main() { }; let mut allocator = Allocator::new(&AllocatorCreateDesc { - device: device.as_windows().clone(), + device: ID3D12DeviceVersion::Device(device.as_windows().clone()), debug_settings: Default::default(), allocation_sizes: Default::default(), }) diff --git a/src/lib.rs b/src/lib.rs index 58927891..64ca125e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -89,7 +89,7 @@ //! # let device = todo!(); //! //! let mut allocator = Allocator::new(&AllocatorCreateDesc { -//! device, +//! device: ID3D12DeviceVersion::Device(device), //! debug_settings: Default::default(), //! allocation_sizes: Default::default(), //! }); @@ -109,7 +109,7 @@ //! # let device = todo!(); //! //! # let mut allocator = Allocator::new(&AllocatorCreateDesc { -//! # device: device, +//! # device: ID3D12DeviceVersion::Device(device), //! # debug_settings: Default::default(), //! # allocation_sizes: Default::default(), //! # }).unwrap();