Skip to content

Commit

Permalink
Fix examples and improve README after #168 merge (#169)
Browse files Browse the repository at this point in the history
The CI isn't holding back PR merges, and some nitty API changes behind
feature toggles slipped through the cracks.
  • Loading branch information
MarijnS95 committed May 16, 2023
1 parent d5de660 commit ddbdcdf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
});
Expand Down
5 changes: 3 additions & 2 deletions examples/d3d12-buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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(),
})
Expand Down
3 changes: 2 additions & 1 deletion examples/d3d12-visualization/main.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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(),
})
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
//! });
Expand All @@ -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();
Expand Down

0 comments on commit ddbdcdf

Please sign in to comment.