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

Support for raw-window-handle #962

Merged
merged 5 commits into from Feb 4, 2020
Merged

Support for raw-window-handle #962

merged 5 commits into from Feb 4, 2020

Conversation

ghost
Copy link

@ghost ghost commented Jan 27, 2020

Taking off from #910: @Lokathor provided some system-specific bindings and I've plucked out the necessary stuff to make this run on macOS, linux, and windows. This definitely runs on macOS, but I was unable to procure linux and windows machines to verify support there. I'm confident it "should work", though.

@Cobrand
Copy link
Member

Cobrand commented Jan 27, 2020

Can you add a test, or an example, so that we can check it works on every platform?

Also, a mention of this feature in the README would be appreciated. People have no way to know there is such a feature unless they manually look in the Cargo.toml.

@ghost
Copy link
Author

ghost commented Jan 28, 2020

@Cobrand I've adding tests for each platform and an example working with wgpu. I had to add a few test dependencies to get the example going, though. Let me know what you think!

@Cobrand
Copy link
Member

Cobrand commented Jan 29, 2020

I'd gladly merge this but the example and the test don't compile on my machine on linux.

Here is the error message:

error: cannot find macro `log` in this scope
  --> /home/cobrand/.cargo/registry/src/github.com-1ecc6299db9ec823/relevant-0.4.2/src/lib.rs:72:13
   |
72 |             sink!("Values of this type can't be dropped!")
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this macro invocation
   |
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to previous error

error: could not compile `relevant`.

Looks like the relevant crate is causing issues, but when I compile it manually the issue doesn't arise... Really weird.

@ghost
Copy link
Author

ghost commented Jan 30, 2020

I'm not sure what's wrong. I was able to get the example to compile with no issues on clean ubuntu and arch installs. What distro are you using?

@Cobrand
Copy link
Member

Cobrand commented Jan 31, 2020

I'm using archlinux, but that should be irrelevant.

I tried deleting my Cargo.lock, and this time I got this error, which comes from the example:

error[E0432]: unresolved import `raw_window_handle::macos`
  --> examples/raw-window-handle-with-wgpu/main.rs:14:24
   |
14 | use raw_window_handle::macos::MacOSHandle;
   |                        ^^^^^ could not find `macos` in `raw_window_handle`

error: aborting due to previous error

A conditional import should do the trick here.

@ghost
Copy link
Author

ghost commented Jan 31, 2020

Bah, I've been burned by IDE auto-imports before. I moved it to where it's actually used.

@Cobrand
Copy link
Member

Cobrand commented Feb 1, 2020

I got a panic inside the wgpu lib now:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value'
...
16: wgpu_request_adapter
             at /home/cobrand/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-native-0.4.3/src/instance.rs:474
  17: wgpu::Adapter::request
             at /home/cobrand/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.4.0/src/lib.rs:545
  18: raw_window_handle_with_wgpu::main
             at examples/raw-window-handle-with-wgpu/main.rs:67
...

I think it's unrelated to this PR (or at least your PR isn't the cause) and I'm ready to merge this, but I just wanted to confirm this with you first.

@Lokathor
Copy link

Lokathor commented Feb 1, 2020

if that's on mac that's expected

@Cobrand
Copy link
Member

Cobrand commented Feb 1, 2020

@Lokathor Still on arch. I have a laptop with bumblebee so that might be an issue, regardless I ran the test both without and with optirun, and in both cases I got the panic.

@ghost
Copy link
Author

ghost commented Feb 1, 2020

I have the same problem on arch. Doesn't look like wgpu is able to figure out the graphics device, though that could be because this is some pretty old hardware.

@Cobrand
Copy link
Member

Cobrand commented Feb 4, 2020

Regardless, it's seems to be an upstream issue and wgpu is only a dev dependency for a specific example, so I think it's safe to merge. Even if it's an issue, no one is using it anyway (for now, since it's not even released), and they can always file an issue then.

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.

2 participants