Closed danieleftodi closed 4 years ago
Sorry,as far as I know, vulkan is not supported by Apple. can you try moltenvk ( https://moltengl.com/moltenvk/ ), but i am not familiar with it. and i don't have a mac, so i can't reproduce this problem. only windows and linux are tested, i can't help in your case, sorry.
There is https://github.com/gfx-rs/portability which is quite similar to moltenvk, and in theory, it can run vkquake3. Sadly I had no success with either one of them, probably because I'm a complete noob in static/dynamic linking.
Let me know if you have any results.
@suijingfeng & @tolnaiz ... TL:DR .... I got it working 🥳 ... I'll shortly make a patch available ...
Sorry, as far as I know, vulkan is not supported by Apple.
That is a bit ... "not quite of a correct statement" 🙃😉 ... like OpenGL, Vulkan and Metal are "just a specification" ... it's not Apple, nor Microsoft nor Linux-developers that have to write the code to add a specification support into a gfx cards driver ... it's the manufacturers (AMD, Nvidia, Intel ... etc etc) ...
Like The Cherno explains in his OpenGL crash course on youtube - Welcome to OpenGL ...
The question is: has AMD, Nvidia, et. al added Vulkan API specification support into the macOS driver that they provide to Apple? ... they've done so for Microsoft and their Linux drivers ... (or just make one available for us to download and install ourselves?) ... I don't know ...
Though we know AMD has added Metal API specification into their gfx drivers for macOS ... and that is why (IMHO) MoltenVK has come about ... to create a translation layer for Vulkan API --to-the--> Metal API ... *yay all of us*
Though, IMHO, all gfx manufacturers (yeah, Apple too, with their own Apple Silicon chips) should add Vulkan API specification to their drivers, and make them available... so developers can try to code once, and support many 🙏🏻 ... so we can once and for all say farewell to OpenGL 😉
R.I.P OpenGL...
can you try moltenvk ( https://moltengl.com/moltenvk/ ), but i am not familiar with it.
TL:DR ... that is what I've done ... sort of ... or didn't have to do at all...
After RTFM-ing and some more debugging it turns out that it was the SDL2 Library that is either to old and/or was compiled without Vulkan API support (for macOS...) ...
...VKimp_SetMode()...
bpp 32 SDL_PIXELFORMAT_ARGB8888 2560 x 1440, refresh_rate: 60Hz
MODE: 3, 640 x 480, refresh rate: 60hz
^3 Couldn't create a window: Vulkan support is either not configured in SDL or not available in video driver
----- Client Shutdown (Client fatal crashed: VKimp_Init() - could not load Vulkan subsystem: Vulkan support is either not configured in SDL or not available in video driver) -----
so I updated the SDL2 Lib to 2.0.12 and it works 👍🏻
...Creating window (using SDL2)...
Found SDL version 2.0.12
Video is not initialized before, so initial it.
SDL using driver "cocoa"
...VKimp_SetMode()...
bpp 32 SDL_PIXELFORMAT_ARGB8888 2560 x 1440, refresh_rate: 60Hz
MODE: -2, 2560 x 1440, refresh rate: 60hz
Available modes: '2560x1440 2048x1152 1600x1200 1600x900 1344x1008 1344x756 1280x960 1280x720 1024x768 1024x576 800x600 640x480'
Loading vulkan instance functions
*** Vulkan Initialization ***
Get instance proc address. (using SDL2)
Creating instance: vk.instance
--- Total 10 instance extensions. ---
--- Vulkan create instance success! ---
There is https://github.com/gfx-rs/portability which is quite similar to moltenvk, and in theory, it can run vkquake3. Sadly I had no success with either one of them, probably because I'm a complete noob in static/dynamic linking.
@tolnaiz : ... the great news is that since 2018 Valve has made sure MoltenVK becomes Open Source and that it gets incorporated into the official Vulkan SDK maintained by the Khronos Group...
And SDL2 also supports Vulkan ... meaning, one doesn't have to do much to have Vulkan support on all platforms SDL2 Lib has support for ... just make sure to compile the SDL2 library with Vulkan support, and not run an old SDL2 lib that doesn't support it (say older then some-time-in-2018-when-SDL2-added-support-for-it?...)
It's indeed working with a newer SDL. Which also solves some assumably mac specific bugs (handling hidpi mode and mouse wheel problems).
Pull request: https://github.com/suijingfeng/vkQuake3/pull/11
@tolnaiz
btw, do you have the same issue? https://github.com/suijingfeng/vkQuake3/issues/12
(yeah, let's continue this talk in that issue ...)
This [Fix] is merged, closing issue.
So, I'm trying to get it working under macOS ... it compiles and runs very well with opengl renderer ... but when I switch to
Here is my crash log: