Vulkan lavapipe software rendering is working on Haiku

I use Vulkan samples from here: https://github.com/SaschaWillems/Vulkan. It use OS API directly. I currently use headless WSI and hacked WSI addon to get window output.

Can you give a link of some simple GLFW Vulkan demo (rotating triangle etc.)?

Have a look at Vulkan Tutorial, it seems to have the most traffic besides Sascha’s pages. Win/linux/osx support with same codebase.

https://vulkan-tutorial.com/en/Development_environment#page_GLFW-2

1 Like

Good day @X512,

A really nice job there, KUDOS!!! I wonder if the hack you are using to get “window output” could be the same needed for Godot to work inside a window instead full screen [@CodeforEvolution, @cocobean]?.

Keep up the good work.
Regards,
RR

6 Likes

Intel Vulkan driver also need futex functions (futex_wake, futex_wait) that currently unavailable on Haiku.

4 Likes

Actually Haiku kernel has similar syscalls (_kernel_mutex_lock etc.) that can be used to implement futexes.

5 Likes

I managed to build Mesa Intel Vulkan driver (libvulkan_intel.so).

Problems:

  1. dl_iterate_phdr function missing.
  2. futex_* functions are not implemented for Haiku.
  3. memmem function is missing (but present in libroot.so source code, probably not included to build). libgnu was needed.
19 Likes

With some hacks Vulkan is working with GLFW and vkgears example. WSI add-on currently creates its own window instead of using GLFW window, so 2 windows are created. Proper support need adding Haiku Vulkan WSI surface extension.

screenshot28

24 Likes

Ilya, thats fantastic, I can now port my next gen Vulkan graphics engine to Haiku. My benchmarks on supported hardware for 4K content went from 1200fps with OpenGL to 2000fps with Vulkan, same scene complexity. Looking forward to running this on Haiku as well.

9 Likes

Nice! So is this hardware accelerated or still software rendering? :smiley:

1 Like

This is software rendering by Mesa Lavapipe. Hardware rendering needs DRM support in kernel. I want to investigate what is actually needed from DRM by Vulkan userland driver. Maybe DRM ioctls can be implemented for existing Haiku kernel drivers such as radeon_hd (initial attempt by @kallisti5) instead of porting large and hardcoded to Linux kernel drivers.

7 Likes

What engine? Can you give a link?

1 Like

Sorry my friend, its a proprietary company engine, used in my employers embedded systems (https://www.atlasgaming.com.au/moregames - like to current OpenGL products, next gen is Vulkan).

Can commercial games be released on Haiku?

1 Like

My employers products are shipped on embedded proprietary hardware, to licensed clients in a regulated market. Not available for the general public.

Lots of embedded systems need 3d graphics stacks (car info systems, kiosks, public displays, and of course phones and tablets). A good opportunity for Haiku some day. And the work you’ve done for Vulkan on Haiku is an excellent starting point …

6 Likes

well, i didn’t quite understand, but even if it’s proprietary, nothing forbids a closed code demo as a working example on haiku, am i right?

p.s. more generally speaking i can’t wait to see demoscene OpenGL (via zink) and Vulkan brought in large quantities here on HAIKU :star_struck:

1 Like

Is this something brand new, started about ten days ago? looking at the code looks like yes, am I right?

In any case I wish you the best of success guys, this could be an incisive milestone.

First patch version date is 24/03/2021.

1 Like

Thanks for correcting me, I had absolutely not seen the various patchsets over the time.
So I started reading all the history of your comments from March until when I saw that kallisti5 proposed on twitter 3 graphs to get to the acceleration.
Which model was finally chosen?

One

Two

Three

2 Likes

I think that they are terrible at architecture designing. DRM kernel driver is over-complicated, non-portable and insecure (more code in kernel means more vulnerabilities). Why they even move graphics driver to kernel?

Vulkan made situation better because of standard userland driver API and windowing system abstraction.

4 Likes