Vulkan lavapipe software rendering is working on Haiku

i don’t have enough knowledge of uni posix linux kernel interfaces to really know where those all go. it looks like a lot of work for sure.

John Bridgman is/was involved with the open source driver team at AMD, he posts on phoronix.com

he could probably get a engineer to help etc.

i wish i had 10% of your skills, I’d be in there getting dirty.

the point I was trying to make was that we don’t need to bring all of the mesa open source driver stack mess to haiku.

2 Likes

It will not help me to make any progress.

1 Like

Yeah, I wasn’t sure if you needed any hardware or not so I just linked to the Haiku Inc page on that - if hardware is donated to Haiku Inc other developers can use it too.

1 Like

I already have Vulkan compatible Radeon and Intel graphics cards so no attitional hardware is needed for now.

7 Likes

Current hardware baseline (Mesa 21.2.2/Vulkan 1.2.193/Haiku R1B3):

  • Vulkan 1.2.193 conformant 3D hardware

Legacy baseline hardware reference (Vulkan 1.0/Haiku R1B3):

  • AMD Radeon HD 2000 series - Y2007
  • Intel HD Graphics (Gen 7) series - Y2012
  • Nvidia Geforce 8000 series - Y2006

Baseline 3D applications supportable on Haiku:

  • Blender 2.93.4
  • Drag[en]gine 1.6
  • Godot 3.3.3
4 Likes

With some hacks window output is added. Proper support will need adding Haiku-specific Vulkan extensions for surface and swapchain.

screenshot21

screenshot23

screenshot24

screenshot22

40 Likes

Can’t wait to see the frames sooner or later go to the moon. :paintbrush:
You are indisputably one of those developers who makes reading this forum an entertainment.

13 Likes

Glfw3 is what most Vulkan samples/tutorials use (over 90%), including my cross platform engine, so I guess a combo of lavapipe/glfw3 is needed for most tutorials on the net to work with a simple recompilation and no code changes. That would be amazing to have. Glfw3 supports Vulkan and can have a count of BBitmaps attached to a BView for Haiku integration.

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