-
Notifications
You must be signed in to change notification settings - Fork 3
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
macOS Support via MoltenVK #13
Comments
In fact, VSand should be really close to support MoltenVK. LWJGL seems to support it natively. However, if you have a jdk11, gradle and git (with LFS) installed on your computer, running the project 'should' be as easy as :
|
I just tried that on MacOS 10.14 after installing Java and Gradle from Homebrew, got the following:
I don't intend to investigate the build issues, but if you reach a point where you can build, I'd be happy to assist with making sure it works with Vulkan Portability. |
Thank you for the log. I made a commit to fix this error, but I'm still blind without OSX test platform. |
Assuming LWJGL supports Vulkan on MacOS already, I tried to investigate further. With some trial and error, I convinced it to locate application {
applicationDefaultJvmArgs = ["-Dorg.lwjgl.librarypath=/Users/dmalyshau/Code/vulkansdk/macOS/lib/"]
} However, now I'm getting the following error:
I tried adding |
Maybe you use an old java version ? You can know with the command To build VSand, you need the 11. |
@Ealrann it builds fine. Java version is 11.0.2 |
Thank you very much for your interest!
Ok, I think you no longer need to do that with the previous commit (I advice you to update your local repo with About the GLFW error:
Haha, I don't have this error on linux/windows... Indeed, the window creation happen inside a thread. Since VSand is based on a big abstraction layer, it's not easy to change that properly. |
More informations (but no solutions for now): The relevant code in LWJGL (EventLoop.java (l.60)): if (Platform.get() == Platform.MACOSX && !isMainThread()) {
throw new IllegalStateException("Please run the JVM with -XstartOnFirstThread and make sure a window toolkit other than GLFW (e.g. AWT or JavaFX) is not initialized.");
} So it's definitely specific to MacOSX. Spasi gave a way to disable this check (it would probably crash):
|
With this option, it's getting slightly further but essentially failing at the same thing:
|
With recent commits, the error with GLFW shouldn't appear anymore, the calls are no longer made in a thread. About
Don't keep that in your build.gradle. |
@Ealrann after updating the source, I'm now getting "cannot find symbol import org.sheepy.lily.vulkan.model.XXX" errors. What am I missing? |
Mhhh, weird. Maybe the submodules are not up to date? Try Otherwise, you could try to make a fresh clone
I just tried to be sure, it works here at least. |
Ok, that worked. It is now failing to create a shader module, claiming the magic number to be invalid (73726576). I'm not used to debugging Java apps, and the usual |
Ok, about the I'm not totally sure if it's a good idea to manage the compiled shaders with git lfs... |
Yeay, thank you for your testing. I see that the game is working, but the UI is not displayed correctly. I'll make a proper MacOS support sooner or latter. |
Is it possible to utilize MoltenVK to add support for macOS? It's a thin wrapper around the native Metal API available on macOS. As an example, the Dolphin project was able to add support using MoltenVK - though that's a C++ project versus Java - hopefully there aren't a significant number of differences or issues preventing implementation.
The text was updated successfully, but these errors were encountered: