go-sdl2 icon indicating copy to clipboard operation
go-sdl2 copied to clipboard

Static libraries compiled without Vulkan support

Open jclc opened this issue 5 years ago • 4 comments

When using the static libraries, trying to load Vulkan results in the error: Vulkan support is either not configured in SDL or not available in current SDL video driver (x11) or platform. The same function doesn't fail when using libs installed on the system. Tested on both amd64/linux and amd64/windows.

The static libraries should be compiled with Vulkan support enabled.

jclc avatar Mar 17 '19 19:03 jclc

As I remember compiling with Vulkan support will add additional dependencies, and I wanted to avoid that. How often is that needed, and where? I don't have experience at all with Vulkan.

Probably will not happen before SDL releases a new version, building all static libraries is time-consuming, and I don't have an automated way to do the build currently. Adding new build flag for all platforms (what platforms Vulkan support?) is not that simple, e.g. even adding libmpg123 for mp3 support was not simple to add.

gen2brain avatar Mar 19 '19 20:03 gen2brain

It shouldn't require anything extra, the headers are included in the source. The only Vulkan types SDL2 even cares about are the instance and surface pointers. Just enable the option in the makefile and it should work. You don't need to worry about the platform support either, SDL2 should know which platforms support it and just disable support on unsupported platforms. On Darwin, it enables support for MoltenVK.

If rebuilding the libraries is too much hassle, I don't have any issue waiting for the next release. I can still use the devel libraries on my system.

Edit: I should clarify that just like OpenGL, Vulkan functions are loaded externally on runtime, so no extra libraries are needed.

jclc avatar Mar 19 '19 20:03 jclc

Here's a demo you can try it out on https://github.com/vulkan-go/demos/tree/master/vulkancube/vulkancube_sdl2

jclc avatar Mar 20 '19 20:03 jclc

Static libraries are updated, now with Vulkan support. I tried your demo and it works.

gen2brain avatar May 12 '20 12:05 gen2brain