mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Rustfmt pass
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use com::WeakPtr;
|
||||
use winapi::um::d3d12sdklayers;
|
||||
#[cfg(any(feature = "libloading", feature = "implicit-link"))]
|
||||
use winapi::Interface as _;
|
||||
use winapi::um::d3d12sdklayers;
|
||||
|
||||
pub type Debug = WeakPtr<d3d12sdklayers::ID3D12Debug>;
|
||||
|
||||
@@ -16,14 +16,11 @@ impl crate::D3D12Lib {
|
||||
let mut debug = Debug::null();
|
||||
let hr = unsafe {
|
||||
let func: libloading::Symbol<Fun> = self.lib.get(b"D3D12GetDebugInterface")?;
|
||||
func(
|
||||
&d3d12sdklayers::ID3D12Debug::uuidof(),
|
||||
debug.mut_void(),
|
||||
)
|
||||
func(&d3d12sdklayers::ID3D12Debug::uuidof(), debug.mut_void())
|
||||
};
|
||||
|
||||
Ok((debug, hr))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Debug {
|
||||
|
||||
@@ -9,9 +9,9 @@ use winapi::um::d3d12;
|
||||
use winapi::Interface;
|
||||
use {pso, query, queue};
|
||||
use {
|
||||
Blob, CachedPSO, CommandAllocator, CommandQueue, D3DResult, DescriptorHeap,
|
||||
Fence, GraphicsCommandList, NodeMask, PipelineState, QueryHeap, Resource, RootSignature,
|
||||
Shader, TextureAddressMode,
|
||||
Blob, CachedPSO, CommandAllocator, CommandQueue, D3DResult, DescriptorHeap, Fence,
|
||||
GraphicsCommandList, NodeMask, PipelineState, QueryHeap, Resource, RootSignature, Shader,
|
||||
TextureAddressMode,
|
||||
};
|
||||
|
||||
pub type Device = WeakPtr<d3d12::ID3D12Device>;
|
||||
@@ -27,7 +27,7 @@ impl crate::D3D12Lib {
|
||||
*mut winapi::um::unknwnbase::IUnknown,
|
||||
winapi::um::d3dcommon::D3D_FEATURE_LEVEL,
|
||||
winapi::shared::guiddef::REFGUID,
|
||||
*mut *mut winapi::ctypes::c_void,
|
||||
*mut *mut winapi::ctypes::c_void,
|
||||
) -> crate::HRESULT;
|
||||
|
||||
let mut device = Device::null();
|
||||
|
||||
16
src/dxgi.rs
16
src/dxgi.rs
@@ -2,7 +2,7 @@ use com::WeakPtr;
|
||||
use std::ptr;
|
||||
use winapi::shared::windef::HWND;
|
||||
use winapi::shared::{dxgi, dxgi1_2, dxgi1_3, dxgi1_4, dxgiformat, dxgitype};
|
||||
use winapi::um::{dxgidebug, d3d12};
|
||||
use winapi::um::{d3d12, dxgidebug};
|
||||
use winapi::Interface;
|
||||
use {CommandQueue, D3DResult, Resource, SampleDesc, HRESULT};
|
||||
|
||||
@@ -56,14 +56,12 @@ pub struct DxgiLib {
|
||||
#[cfg(feature = "libloading")]
|
||||
impl DxgiLib {
|
||||
pub fn new() -> Result<Self, libloading::Error> {
|
||||
libloading::Library::new("dxgi.dll")
|
||||
.map(|lib| DxgiLib {
|
||||
lib,
|
||||
})
|
||||
libloading::Library::new("dxgi.dll").map(|lib| DxgiLib { lib })
|
||||
}
|
||||
|
||||
pub fn create_factory2(
|
||||
&self, flags: FactoryCreationFlags
|
||||
&self,
|
||||
flags: FactoryCreationFlags,
|
||||
) -> Result<D3DResult<Factory4>, libloading::Error> {
|
||||
type Fun = extern "system" fn(
|
||||
winapi::shared::minwindef::UINT,
|
||||
@@ -94,11 +92,7 @@ impl DxgiLib {
|
||||
let mut queue = InfoQueue::null();
|
||||
let hr = unsafe {
|
||||
let func: libloading::Symbol<Fun> = self.lib.get(b"DXGIGetDebugInterface1")?;
|
||||
func(
|
||||
0,
|
||||
&dxgidebug::IDXGIInfoQueue::uuidof(),
|
||||
queue.mut_void(),
|
||||
)
|
||||
func(0, &dxgidebug::IDXGIInfoQueue::uuidof(), queue.mut_void())
|
||||
};
|
||||
Ok((queue, hr))
|
||||
}
|
||||
|
||||
@@ -93,9 +93,6 @@ pub struct D3D12Lib {
|
||||
#[cfg(feature = "libloading")]
|
||||
impl D3D12Lib {
|
||||
pub fn new() -> Result<Self, libloading::Error> {
|
||||
libloading::Library::new("d3d12.dll")
|
||||
.map(|lib| D3D12Lib {
|
||||
lib,
|
||||
})
|
||||
libloading::Library::new("d3d12.dll").map(|lib| D3D12Lib { lib })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user