-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use raw-window-metal to get a CAMetalLayer from raw-window-handle
The way `raw-window-metal` works is by creating a layer, and inserting that as a sublayer, just like we did on iOS before. The bounds are then kept in-sync with an observer, ensuring smooth resizing. This also fixes compilation errors on iOS, and adds preliminary support for tvOS. The implementation now solely uses `VK_EXT_metal_surface`, which was added in 2018, and I've removed support for `VK_MVK_ios_surface` / `VK_MVK_macos_surface`, which are deprecated, and only available a year and a half earlier anyhow. Note that apart from the above, there is a slight behavioral change on macOS: we no longer set `edgeAntialiasingMask` on the layer, as it's not really required, and allows us to avoid depending on `objc2` directly. It was introduced without motivation in 40e0b24, so I doubt anyone uses it, and if they do, they can change it on the layer themselves.
- Loading branch information
Showing
15 changed files
with
174 additions
and
437 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,10 @@ | |
name = "vulkano-win" | ||
version = "0.34.0" | ||
edition = "2021" | ||
authors = ["Pierre Krieger <[email protected]>", "The vulkano contributors"] | ||
authors = [ | ||
"Pierre Krieger <[email protected]>", | ||
"The vulkano contributors", | ||
] | ||
repository = "https://github.com/vulkano-rs/vulkano/tree/master/vulkano-win" | ||
description = "Link between vulkano and winit" | ||
license = "MIT OR Apache-2.0" | ||
|
@@ -16,8 +19,8 @@ readme = "../README.md" | |
default = ["winit", "raw-window-handle"] | ||
raw-window-handle = ["dep:raw-window-handle"] | ||
raw-window-handle_ = ["dep:raw-window-handle"] | ||
winit = ["dep:winit", "dep:objc", "dep:core-graphics-types"] | ||
winit_ = ["dep:winit", "dep:objc", "dep:core-graphics-types"] | ||
winit = ["dep:winit"] | ||
winit_ = ["dep:winit"] | ||
|
||
# NOTE(Marc): The dependencies here are not workspace dependencies because vulkano-win is | ||
# deprecated and won't be receiving updates. | ||
|
@@ -27,6 +30,5 @@ raw-window-handle = { version = "0.5", optional = true } | |
vulkano = { workspace = true } | ||
winit = { version = "0.28", optional = true } | ||
|
||
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies] | ||
objc = { version = "0.2.5", optional = true } | ||
core-graphics-types = { version = "0.1", optional = true } | ||
[target.'cfg(target_vendor = "apple")'.dependencies] | ||
raw-window-metal.workspace = true |
Oops, something went wrong.