-
Notifications
You must be signed in to change notification settings - Fork 7
Surface creation on MoltenVK fails due to missing CAMetalLayer with a new winit window #8
Comments
Thanks for the report.
The 2nd point could maybe be done together with gfx-rs? Right now, gfx-hal requires either a |
wgpu seems to support the |
If you have a sense for what the code should be, would it make sense to draft a branch so someone with access to a suitable environment can test it and report back? |
I'm currently extracing the relevant code pieces from gfx sources into https://github.com/norse-rs/raw-window-metal and hoping to move it into the gfx-rs organization afterwards as they have more resources and a larger userbase over there |
Awesome! Does it really make sense for that to be a separate crate, though? It seems like ash-window could subsume gfx's vulkan surface construction across all platforms, unless I'm missing something. |
The metal and vulkan backend of gfx currently use these code pieces therefore I went with a separate crate. An open question for me is if handling of resize or hdpi changes is required, which would make it difficult to go with the manual layer allocation. This might require that the user allocates and maintains a CAMetalLayer themself |
Ah, that makes sense.
I really want to be able to just plug winit into ash and not have to think about platforms; that's the big win with ash-window so far. I have no idea what constraints there are on the macos side, but I hope there's a way forward that preserves that. |
closed by #9 |
Released in |
VK_ERROR_INITIALIZATION_FAILED: vkCreateMacOSSurfaceMVK(): On-screen rendering requires a layer of type CAMetalLayer.
See also gfx-rs/gfx#2838, wherein gfx fixed this error by checking for a
CAMetalLayer
and constructing one if absent using macos APIs. Presumably we can copy their code. I'm probably not the best person to draft this, as I have no access to macos for testing.The text was updated successfully, but these errors were encountered: