Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🪟 Update to windows 0.58 #236

Merged
merged 4 commits into from
Jul 15, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
# allowing the 0.0.6 release to be used (but not the 1.0.0 release).
cargo update -p malloc_buf --precise 0.0.6
- name: Cargo clippy with minimal-versions
run: cargo +stable clippy --workspace --all-targets --features ${{ matrix.features }} --no-default-features -- -D warnings
run: cargo +stable clippy --workspace --features ${{ matrix.features }} --no-default-features -- -D warnings

doc:
name: Build documentation
Expand Down
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ metal = { version = "0.28.0", git = "https://github.com/gfx-rs/metal-rs", rev =
winapi = { version = "0.3.9", features = ["d3d12", "winerror", "impl-default", "impl-debug"], optional = true }

[target.'cfg(windows)'.dependencies.windows]
version = ">=0.53,<=0.57"
version = ">=0.53,<=0.58"
features = [
"Win32_Graphics_Direct3D12",
"Win32_Graphics_Dxgi_Common",
Expand All @@ -57,7 +57,8 @@ env_logger = "0.10"
winapi = { version = "0.3.9", features = ["d3d12", "d3d12sdklayers", "dxgi1_6", "winerror", "impl-default", "impl-debug", "winuser", "windowsx", "libloaderapi"] }

[target.'cfg(windows)'.dev-dependencies.windows]
version = ">=0.53,<=0.57"
# API-breaks since Windows 0.58 only affect our examples
version = "0.58"
features = [
"Win32_Graphics_Direct3D",
"Win32_Graphics_Direct3D12",
Expand Down
7 changes: 4 additions & 3 deletions examples/d3d12-buffer-winrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ fn create_d3d12_device(dxgi_factory: &IDXGIFactory6) -> Option<ID3D12Device> {
};
let adapter4: IDXGIAdapter4 = adapter1.cast().unwrap();

let mut desc = Default::default();
unsafe { adapter4.GetDesc3(&mut desc) }.unwrap();
let desc = unsafe { adapter4.GetDesc3() }.unwrap();
// Skip software adapters
// Vote for https://github.com/microsoft/windows-rs/issues/793!
if (desc.Flags & DXGI_ADAPTER_FLAG3_SOFTWARE) == DXGI_ADAPTER_FLAG3_SOFTWARE {
Expand Down Expand Up @@ -86,7 +85,9 @@ fn create_d3d12_device(dxgi_factory: &IDXGIFactory6) -> Option<ID3D12Device> {
fn main() -> Result<()> {
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("trace")).init();

let dxgi_factory = unsafe { CreateDXGIFactory2(0) }?;
let dxgi_factory = unsafe {
CreateDXGIFactory2(windows::Win32::Graphics::Dxgi::DXGI_CREATE_FACTORY_FLAGS::default())
}?;

let device = create_d3d12_device(&dxgi_factory).expect("Failed to create D3D12 device.");

Expand Down