From 37505e7bbd2a520ffa2a41ec2577ea87e937ea00 Mon Sep 17 00:00:00 2001 From: xiaopengli89 Date: Sun, 30 Jan 2022 15:23:17 +0800 Subject: [PATCH] Fix code style --- wgpu-hal/src/dx12/adapter.rs | 9 +++------ wgpu-hal/src/dx12/instance.rs | 3 +-- wgpu-hal/src/dx12/mod.rs | 10 ++++++---- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/wgpu-hal/src/dx12/adapter.rs b/wgpu-hal/src/dx12/adapter.rs index 4088ed13d9..5acc37c953 100644 --- a/wgpu-hal/src/dx12/adapter.rs +++ b/wgpu-hal/src/dx12/adapter.rs @@ -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}, }; @@ -121,7 +118,7 @@ impl super::Adapter { if let Ok(output2) = output.cast::().into_result() { - info.mpo = output2.SupportsOverlays() == TRUE; + info.mpo = output2.SupportsOverlays() == minwindef::TRUE; output2.destroy(); } output.destroy(); diff --git a/wgpu-hal/src/dx12/instance.rs b/wgpu-hal/src/dx12/instance.rs index 005bed3f24..e430d48d3d 100644 --- a/wgpu-hal/src/dx12/instance.rs +++ b/wgpu-hal/src/dx12/instance.rs @@ -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}, diff --git a/wgpu-hal/src/dx12/mod.rs b/wgpu-hal/src/dx12/mod.rs index 4b7dbd62b3..7e1ec8e884 100644 --- a/wgpu-hal/src/dx12/mod.rs +++ b/wgpu-hal/src/dx12/mod.rs @@ -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 _, }; @@ -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)), @@ -157,7 +159,7 @@ struct SwapChain { enum SurfaceTarget { WndHandle(windef::HWND), - Visual(native::WeakPtr), + Visual(native::WeakPtr), } pub struct Surface {