Skip to content
This repository was archived by the owner on Oct 26, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[package]
name = "d3d12"
version = "0.2.2"
authors = ["msiglreith <[email protected]>"]
version = "0.3.0"
authors = [
"msiglreith <[email protected]>",
"Dzmitry Malyshau <[email protected]>",
]
description = "Low level D3D12 API wrapper"
repository = "https://github.com/gfx-rs/d3d12-rs"
keywords = ["windows", "graphics"]
Expand All @@ -10,7 +13,7 @@ documentation = "https://docs.rs/d3d12"
categories = ["memory-management"]

[features]
libstatic = []
implicit-link = []

[dependencies]
bitflags = "1"
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ build: false
test_script:
- cargo check
- cargo check --features libloading
- cargo check --features libstatic
- cargo check --features implicit-link
- cargo check --all-features
4 changes: 2 additions & 2 deletions src/debug.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use com::WeakPtr;
#[cfg(any(feature = "libloading", feature = "libstatic"))]
#[cfg(any(feature = "libloading", feature = "implicit-link"))]
use winapi::Interface as _;
use winapi::um::d3d12sdklayers;

Expand Down Expand Up @@ -27,7 +27,7 @@ impl crate::D3D12Lib {
}

impl Debug {
#[cfg(feature = "libstatic")]
#[cfg(feature = "implicit-link")]
pub fn get_interface() -> crate::D3DResult<Self> {
let mut debug = Debug::null();
let hr = unsafe {
Expand Down
2 changes: 1 addition & 1 deletion src/descriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ impl crate::D3D12Lib {
}

impl RootSignature {
#[cfg(feature = "libstatic")]
#[cfg(feature = "implicit-link")]
pub fn serialize(
version: RootSignatureVersion,
parameters: &[RootParameter],
Expand Down
2 changes: 1 addition & 1 deletion src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl crate::D3D12Lib {
}

impl Device {
#[cfg(feature = "libstatic")]
#[cfg(feature = "implicit-link")]
pub fn create<I: Interface>(
adapter: WeakPtr<I>,
feature_level: crate::FeatureLevel,
Expand Down
3 changes: 2 additions & 1 deletion src/dxgi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ pub type SwapChain1 = WeakPtr<dxgi1_2::IDXGISwapChain1>;
pub type SwapChain3 = WeakPtr<dxgi1_4::IDXGISwapChain3>;

#[cfg(feature = "libloading")]
#[derive(Debug)]
pub struct DxgiLib {
lib: libloading::Library,
}
Expand Down Expand Up @@ -160,7 +161,7 @@ impl Factory2 {
}

impl Factory4 {
#[cfg(feature = "libstatic")]
#[cfg(feature = "implicit-link")]
pub fn create(flags: FactoryCreationFlags) -> D3DResult<Self> {
let mut factory = Factory4::null();
let hr = unsafe {
Expand Down
11 changes: 11 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ impl Error {
}

#[cfg(feature = "libloading")]
#[derive(Debug)]
pub struct D3D12Lib {
lib: libloading::Library,
}

#[cfg(feature = "libloading")]
impl D3D12Lib {
pub fn new() -> libloading::Result<Self> {
libloading::Library::new("d3d12.dll")
.map(|lib| D3D12Lib {
lib,
})
}
}
2 changes: 0 additions & 2 deletions src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ pub struct DiscardRegion<'a> {
pub subregions: Range<Subresource>,
}

pub type Heap = WeakPtr<d3d12::ID3D12Heap>;

pub type Resource = WeakPtr<d3d12::ID3D12Resource>;

impl Resource {
Expand Down