Skip to content

Commit

Permalink
Add the MetalPerformanceShadersGraph framework
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Dec 15, 2024
1 parent fe22e49 commit cd49441
Show file tree
Hide file tree
Showing 16 changed files with 372 additions and 16 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/header-translator/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ impl<'config> LocationLibrary<'_, 'config> {
}
}

// FIXME: This is currently wrong for nested umbrella frameworks
// (specifically MetalPerformanceShaders).
fn feature(&self) -> Option<String> {
match self {
Self::Block2 => Some("block2".to_string()),
Expand Down
4 changes: 3 additions & 1 deletion crates/header-translator/src/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,9 @@ see that for related crates.", self.data.krate, self.link_name)?;
array.set_trailing("\n");
array.set_trailing_comma(true);
}
cargo_toml["features"][feature] = value(array);
if cargo_toml["features"].get(&feature).is_none() {
cargo_toml["features"][feature] = value(array);
}
}

fs::write(crate_dir.join("Cargo.toml"), cargo_toml.to_string())?;
Expand Down
9 changes: 6 additions & 3 deletions crates/header-translator/src/rust_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,9 @@ impl Ty {
TypeKind::Pointer => {
let mut parser = AttributeParser::new(&attributed_name, &name);
let pointee = ty.get_pointee_type().expect("pointer to have pointee");
if let TypeKind::FunctionPrototype = pointee.get_kind() {
if let TypeKind::FunctionPrototype | TypeKind::FunctionNoPrototype =
pointee.get_kind()
{
parser.set_fn_ptr();
}

Expand Down Expand Up @@ -1026,7 +1028,8 @@ impl Ty {
to: Box::new(Self::parse(to, Lifetime::Unspecified, context)),
}
}
TypeKind::FunctionPrototype => {
// Assume that functions without a prototype simply have 0 arguments.
TypeKind::FunctionPrototype | TypeKind::FunctionNoPrototype => {
let call_conv = ty.get_calling_convention().expect("fn calling convention");
assert_eq!(
call_conv,
Expand All @@ -1045,7 +1048,7 @@ impl Ty {
let result_type = Self::parse(result_type, Lifetime::Unspecified, context);

Self::Fn {
is_variadic: ty.is_variadic(),
is_variadic: ty.get_kind() == TypeKind::FunctionPrototype && ty.is_variadic(),
no_escape,
arguments,
result_type: Box::new(result_type),
Expand Down
1 change: 1 addition & 0 deletions crates/objc2/src/topics/about_generated/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `EventKitUI` / `objc2-event-kit-ui`.
- `IOSurface` / `objc2-io-surface`.
- `MetalPerformanceShaders` / `objc2-metal-performance-shaders`.
- `MetalPerformanceShadersGraph` / `objc2-metal-performance-shaders-graph`.
- `OpenDirectory` / `objc2-open-directory`.
- `ScreenSaver` / `objc2-screen-saver`.
* Added `#[must_use]` attributes where the C headers have them.
Expand Down
1 change: 1 addition & 0 deletions crates/objc2/src/topics/about_generated/list_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
| `MetalFX` | [![`objc2-metal-fx`](https://badgen.net/crates/v/objc2-metal-fx)](https://crates.io/crates/objc2-metal-fx) | [![docs.rs](https://docs.rs/objc2-metal-fx/badge.svg)](https://docs.rs/objc2-metal-fx/) |
| `MetalKit` | [![`objc2-metal-kit`](https://badgen.net/crates/v/objc2-metal-kit)](https://crates.io/crates/objc2-metal-kit) | [![docs.rs](https://docs.rs/objc2-metal-kit/badge.svg)](https://docs.rs/objc2-metal-kit/) |
| `MetalPerformanceShaders` | [![`objc2-metal-performance-shaders`](https://badgen.net/crates/v/objc2-metal-performance-shaders)](https://crates.io/crates/objc2-metal-performance-shaders) | [![docs.rs](https://docs.rs/objc2-metal-performance-shaders/badge.svg)](https://docs.rs/objc2-metal-performance-shaders/) |
| `MetalPerformanceShadersGraph` | [![`objc2-metal-performance-shaders-graph`](https://badgen.net/crates/v/objc2-metal-performance-shaders-graph)](https://crates.io/crates/objc2-metal-performance-shaders-graph) | [![docs.rs](https://docs.rs/objc2-metal-performance-shaders-graph/badge.svg)](https://docs.rs/objc2-metal-performance-shaders-graph/) |
| `MetricKit` | [![`objc2-metric-kit`](https://badgen.net/crates/v/objc2-metric-kit)](https://crates.io/crates/objc2-metric-kit) | [![docs.rs](https://docs.rs/objc2-metric-kit/badge.svg)](https://docs.rs/objc2-metric-kit/) |
| `MultipeerConnectivity` | [![`objc2-multipeer-connectivity`](https://badgen.net/crates/v/objc2-multipeer-connectivity)](https://crates.io/crates/objc2-multipeer-connectivity) | [![docs.rs](https://docs.rs/objc2-multipeer-connectivity/badge.svg)](https://docs.rs/objc2-multipeer-connectivity/) |
| `NaturalLanguage` | [![`objc2-natural-language`](https://badgen.net/crates/v/objc2-natural-language)](https://crates.io/crates/objc2-natural-language) | [![docs.rs](https://docs.rs/objc2-natural-language/badge.svg)](https://docs.rs/objc2-natural-language/) |
Expand Down
286 changes: 286 additions & 0 deletions framework-crates/objc2-metal-performance-shaders-graph/Cargo.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions framework-crates/objc2-metal-performance-shaders-graph/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cd49441

Please sign in to comment.