gfx-rs/gfx

Using default nsview if not provided by raw-window-handle

aclysma opened this issue · 5 comments

Short info header:

  • GFX version: gfx-backend-metal 0.5.6
  • OS: macOS
  • GPU: 5700 XT

Would it make sense to apply this change https://github.com/gfx-rs/wgpu/pull/462/files in wgpu to Instance::create_surface?

I am hitting this when adding SDL2 as a backend to bevy.

kvark commented

Yes, that would make sense

I wasn't sure what branch to put this on. bevy looks like it's using 0.5, and I only applied the change to that branch but only macOS since that's what I'm testing on. This looks like it resolves the issue for me but not sure how you want to proceed with upstreaming this fix.

fyi I extracted the conversion process for Metal out in a separate crates (https://github.com/norse-rs/raw-window-metal) for ash-window which might come in handy here. It walks through the handle and tries to retrieve or allocate a CAMetalLayer out of it.

kvark commented

Let's use it then!

cart commented

Bevy has a 0.6.0 wgpu master branch here you can test on: https://github.com/bevyengine/bevy/commits/wgpu_upgrade

We should focus on supporting that given how close 0.6.0 is.