Skip to content

Commit

Permalink
Upgrade to windows 0.51
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnS95 committed Aug 16, 2023
1 parent 82b8d8c commit 8263f5e
Show file tree
Hide file tree
Showing 13 changed files with 374 additions and 625 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
((Resolve-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\*\bin\Hostx64\x64")
| Sort-Object -Descending | Select -First 1).ToString() >> $env:GITHUB_PATH
- name: Generate
run: dotnet build .metadata
run: dotnet build .metadata
- name: Upload
uses: actions/upload-artifact@v3
with:
Expand All @@ -49,12 +49,14 @@ jobs:
with:
name: metadata
path: .windows/winmd
- name: Install riddle
run: cargo install --git https://github.com/microsoft/windows-rs --rev f1b1edd riddle
- name: Generate
run: cargo r -p api_gen
run: riddle --etc bindings.txt
- name: Upload crate source
uses: actions/upload-artifact@v3
with:
name: crate-source
path: src/
- name: Diff generated Rust code
run: test -z "$(git status --porcelain -- '!.windows')" || (echo "::error::Generated files are different, please regenerate with cargo run -p api_gen!"; git diff; false)
run: test -z "$(git status --porcelain -- '!.windows')" || (echo "::error::Generated files are different, please regenerate with riddle --etc bindings.txt!"; git diff; false)
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ dotnet build .metadata
From the root of the repository:

```sh
cargo run -p api_gen
cargo install --git https://github.com/microsoft/windows-rs --rev f1b1edd riddle
riddle --etc bindings.txt
```
8 changes: 3 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ include = ["src", "LICENSE"]
[dependencies]
anyhow = "1"
libloading = "0.8"
# Autogenerated bindings reference `::windows_core` instead of `::windows::core`
windows-core = "0.51"

[dependencies.windows]
# TODO: Switch to windows-core when it is published
version = "0.48"
version = "0.51"
features = [
"implement",
"Win32_Foundation",
"Win32_Graphics_Direct3D12",
"Win32_Graphics_Dxgi_Common",
]

[workspace]
members = ["api_gen"]
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Rust bindings for AMD's DirectX12 RGP markers

[![Actions Status](https://github.com/Traverse-Research/amd-ext-d3d-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/Traverse-Research/amd-ext-d3d-rs/actions/workflows/ci.yml)
[![Latest version](https://img.shields.io/crates/v/amd-ext-d3d.svg)](https://crates.io/crates/amd-ext-d3d)
[![Latest version](https://img.shields.io/crates/v/amd-ext-d3d.svg?logo=rust)](https://crates.io/crates/amd-ext-d3d)
[![Documentation](https://docs.rs/amd-ext-d3d/badge.svg)](https://docs.rs/amd-ext-d3d)
[![Lines of code](https://tokei.rs/b1/github/Traverse-Research/amd-ext-d3d-rs)](https://github.com/Traverse-Research/amd-ext-d3d-rs)
![MIT](https://img.shields.io/badge/license-MIT-blue.svg)
Expand All @@ -25,8 +25,10 @@ While [upstream documentation] details how to embed these calls into existing PI
```rust,no_run
use amd_ext_d3d::AmdExtD3DDevice;
use std::ffi::CStr;
use windows::core::CanInto;
use windows::Win32::Graphics::Direct3D12::{ID3D12Device, ID3D12GraphicsCommandList};
use windows::{
core::CanInto,
Win32::Graphics::Direct3D12::{ID3D12Device, ID3D12GraphicsCommandList},
};
let device: ID3D12Device = todo!("Open DirectX12 graphics device");
let cmd_list: ID3D12GraphicsCommandList = todo!("device.CreateCommandList(...)");
Expand Down
10 changes: 0 additions & 10 deletions api_gen/Cargo.toml

This file was deleted.

50 changes: 0 additions & 50 deletions api_gen/src/main.rs

This file was deleted.

5 changes: 5 additions & 0 deletions bindings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--in .windows/winmd/
--out src/Amd.rs

--filter
Amd
9 changes: 1 addition & 8 deletions release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ sign-tag = true
publish = false

pre-release-replacements = [
{file="README.md", search="amd-ext-d3d = .*", replace="{{crate_name}} = \"{{version}}\""},
{ file = "README.md", search = "amd-ext-d3d = .*", replace = "{{crate_name}} = \"{{version}}\"" },
]

# cargo-release only allows using {{version}} in the commit title when creating one
# commit across all released packages in this workspace (we only release one package
# though), or by using the same version for all packages.
# https://github.com/crate-ci/cargo-release/issues/540#issuecomment-1328769105
# https://github.com/crate-ci/cargo-release/commit/3af94caa4b9bbee010a5cf3f196cc4afffbaf192
consolidate-commits = false
shared-version = true
Loading

0 comments on commit 8263f5e

Please sign in to comment.