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

MoltenVK on High Sierra: GLFW reports that vulkan is not supported! #20

Closed
o1lo01ol1o opened this issue Dec 15, 2018 · 7 comments
Closed

Comments

@o1lo01ol1o
Copy link
Contributor

The readme states that vulkan-api was tested on MoltenVK. How was GLFW linked to vulkan? It looks like GLFW-b packages a version of glfw the potentially predates MoltenVK support. I'm abled to install glfw (via source) and am told that I finds the vulkan libraries. However, it looks like stack build in vulkan-examples links the wrong glfw:

stack exec ve-06-Drawing
GLFW version: 3.2.1 Cocoa NSGL chdir menubar retina
Terminated GLFW.
ve-06-Drawing: VulkanException {vkeCode = Nothing, vkeMessage = "GLFW reports that vulkan is not supported!"}

@o1lo01ol1o
Copy link
Contributor Author

Ok, I now see that bsl/bindings-GLFW#58 and your work on MoltenVK support predates the most recent hackage upload, so that much is answered. I've added the moltenVK lib and include directories to the extra-lib-dirs and extra-include-dirs in the stack.yaml, but still not dice.

@achirkin
Copy link
Owner

GLFW supports MoltenVK since version 3.3. I wanted to update bindings-GLFW to this version, but did not come to actually doing it, because my primary machine is linux.
At the same time, vulkan-api worked for me with MoltenVK - windowless. So, if you want to get triangles on a screen of Mac OS, you need to start with bindings-GLFW/Upgrade-3.3. You can also try to create a window handle using GLFW without asking for Vulkan, then manually query for required Mac OS window extensions.

@o1lo01ol1o
Copy link
Contributor Author

So bindings-GLFW does not yet support MoltenVK and this would need to implemented in the Upgrade-3.3 branch. The alternate, untested, approach would be to use GLFW without vulkan support and handle the vulkan-GLFW some other way. Is this correct?

@achirkin
Copy link
Owner

Yep, this is correct. Personally, I think the first option is easier :)

@o1lo01ol1o
Copy link
Contributor Author

Is there a guide to the first option? :)

@achirkin
Copy link
Owner

In general, you just replace the content of bindings-GLFW/glfw/ folder with the release 3.3 GLFW source code, and then carefully add new bindings to bindings-GLFW/Bindings/GLFW.hsc.The latter is pretty intuitive, just follow the logic of the previously defined functions :)
Afterwards, you would need to update higher-level bindings via GLFW-b/util/genC.hs.

@o1lo01ol1o
Copy link
Contributor Author

Thanks for the overview, I'll give it a shot.

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

No branches or pull requests

2 participants