Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaopengli89 committed Jan 30, 2022
1 parent a8c3dd1 commit 37505e7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
9 changes: 3 additions & 6 deletions wgpu-hal/src/dx12/adapter.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use super::{conv, HResult as _};
use crate::dx12::SurfaceTarget;
use super::{conv, HResult as _, SurfaceTarget};
use std::{mem, sync::Arc, thread};
use winapi::shared::dxgi1_3;
use winapi::shared::minwindef::TRUE;
use winapi::{
shared::{dxgi, dxgi1_2, dxgi1_5, minwindef, windef, winerror},
shared::{dxgi, dxgi1_2, dxgi1_3, dxgi1_5, minwindef, windef, winerror},
um::{d3d12, d3d12sdklayers, winuser},
};

Expand Down Expand Up @@ -121,7 +118,7 @@ impl super::Adapter {
if let Ok(output2) =
output.cast::<dxgi1_3::IDXGIOutput2>().into_result()
{
info.mpo = output2.SupportsOverlays() == TRUE;
info.mpo = output2.SupportsOverlays() == minwindef::TRUE;
output2.destroy();
}
output.destroy();
Expand Down
3 changes: 1 addition & 2 deletions wgpu-hal/src/dx12/instance.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use super::HResult as _;
use crate::dx12::SurfaceTarget;
use super::{HResult as _, SurfaceTarget};
use std::{borrow::Cow, slice, sync::Arc};
use winapi::{
shared::{dxgi, dxgi1_2, dxgi1_6, winerror},
Expand Down
10 changes: 6 additions & 4 deletions wgpu-hal/src/dx12/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ mod view;
use arrayvec::ArrayVec;
use parking_lot::Mutex;
use std::{borrow::Cow, ffi, mem, num::NonZeroU32, ptr, sync::Arc};
use winapi::um::dcomp::IDCompositionVisual;
use winapi::{
shared::{dxgi, dxgi1_2, dxgi1_4, dxgitype, windef, winerror},
um::{d3d12, synchapi, winbase, winnt},
um::{d3d12, dcomp, synchapi, winbase, winnt},
Interface as _,
};

Expand Down Expand Up @@ -131,7 +130,10 @@ pub struct Instance {
}

impl Instance {
pub unsafe fn create_surface_from_visual(&self, visual: *mut IDCompositionVisual) -> Surface {
pub unsafe fn create_surface_from_visual(
&self,
visual: *mut dcomp::IDCompositionVisual,
) -> Surface {
Surface {
factory: self.factory,
target: SurfaceTarget::Visual(native::WeakPtr::from_raw(visual)),
Expand All @@ -157,7 +159,7 @@ struct SwapChain {

enum SurfaceTarget {
WndHandle(windef::HWND),
Visual(native::WeakPtr<IDCompositionVisual>),
Visual(native::WeakPtr<dcomp::IDCompositionVisual>),
}

pub struct Surface {
Expand Down

0 comments on commit 37505e7

Please sign in to comment.