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

ash-window: Upgrade to raw-window-handle 0.4.2 #505

Merged
merged 1 commit into from
Jul 29, 2022
Merged

ash-window: Upgrade to raw-window-handle 0.4.2 #505

merged 1 commit into from
Jul 29, 2022

Conversation

MarijnS95
Copy link
Collaborator

@MarijnS95 MarijnS95 commented Dec 1, 2021

Note that this depends on one of the many winit 0.25 example upgrades (though we'll require 0.26 to make raw-window-handle 0.4 work) in order to succeed compilation on the examples.


Not sure about the timing on this one: raw-window-handle just came out, and winit 0.26 too. There's a compatibility in 0.3.4 that allows consumers like this ash-window crate to consume the 0.4 handle (because the trait is implemented for it) produced by ie. winit, so there's a good reason to stay on 0.3.4 for longer to have wider adoption before migrating the ash-window crate - which is unfortunately tied in to the ash version! This just provides a git branch/rev for crate authors to use if they desire to deduplicate their raw-window-handle dependency in the crate graph.

I wonder if we can use a lower and upper version bound on ash and just perform minor releases of ash-window to increase that upper bound whenever a new, compatible version of ash is released. A bit like the proposed fixes for vma. We can keep two ash-window major releases in parallel, but that's going to get hairy as soon as there's a breaking change in ash (in fact the unreleased "Support linking vulkan directly" PR changes our API surface already).


The match arms are not guarded by cfg anymore, allowing us to compile-test these simple arms on every system whenever our Ash extension helpers and types are not guarded by cfg attributes either. This applies to every platform except Mac/IOS where the symbols and external raw-window-metal crate are themselves guarded by cfg's.

CC @msiglreith, seems like we need an update to https://github.com/norse-rs/raw-window-metal before this could even work :)

@MarijnS95
Copy link
Collaborator Author

Thanks @msiglreith, seems we can update to norse-rs/raw-window-metal#4 (v0.2) without any other changes (though the CI doesn't build-test a mac/ios build afaik).

@MarijnS95 MarijnS95 mentioned this pull request Jan 8, 2022
@dvc94ch
Copy link

dvc94ch commented Jan 10, 2022

What is this waiting on?

@MarijnS95
Copy link
Collaborator Author

MarijnS95 commented Jan 10, 2022

@dvc94ch As long as we stick on 0.3.4, this crate can be used with both the 0.3.4 and 0.4.1 HasRawWindowHandle trait implementors. When we upgrade that fallback to 0.3.4 is gone, so it actually makes sense to just stay on 0.3.4 - until we start missing functionality.

@dvc94ch
Copy link

dvc94ch commented Jan 10, 2022

Not quite sure what you mean, this is the error I get with the winit provided handle:

error[E0308]: mismatched types
   --> piet-gpu-hal/src/vulkan.rs:176:70
    |
176 |                 for ext in ash_window::enumerate_required_extensions(*handle)? {
    |                                                                      ^^^^^^^ expected trait `raw_window_handle::HasRawWindowHandle`, found trait `HasRawWindowHandle`
    |
    = note: expected reference `&dyn raw_window_handle::HasRawWindowHandle`
               found reference `&dyn HasRawWindowHandle`
    = note: perhaps two different versions of crate `raw_window_handle` are being used?

error[E0308]: mismatched types
   --> piet-gpu-hal/src/vulkan.rs:226:76
    |
226 |                     surface: ash_window::create_surface(&entry, &instance, handle, None)?,
    |                                                                            ^^^^^^ expected trait `raw_window_handle::HasRawWindowHandle`, found trait `HasRawWindowHandle`
    |
    = note: expected reference `&dyn raw_window_handle::HasRawWindowHandle`
               found reference `&dyn HasRawWindowHandle`
    = note: perhaps two different versions of crate `raw_window_handle` are being used?

@MarijnS95
Copy link
Collaborator Author

@dvc94ch I think #553 may be of interest to you.

The match arms are not guarded by `cfg` anymore, allowing us to
compile-test these simple arms on every system whenever our Ash
extension helpers and types are not guarded by `cfg` attributes either.
This applies to every platform except Mac/IOS where the symbols and
external raw-window-metal crate are themselves guarded by cfg's.
@MarijnS95 MarijnS95 merged commit da49568 into master Jul 29, 2022
@MarijnS95 MarijnS95 deleted the rw-0.4 branch July 29, 2022 20:19
MarijnS95 added a commit that referenced this pull request Jul 29, 2022
The match arms are not guarded by `cfg` anymore, allowing us to
compile-test these simple arms on every system whenever our Ash
extension helpers and types are not guarded by `cfg` attributes either.
This applies to every platform except Mac/IOS where the symbols and
external raw-window-metal crate are themselves guarded by cfg's.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants