Vulkan renderer

As many of you may know, Khronos released the new Vulkan graphics API last week. It’s a low-level alternative to OpenGL that offers much more low-level control over the hardware, offering the potential of reduced driver overhead and allowing the engine to perform multi-threaded rendering. It is seen by many as the successor to OpenGL - which is over 20 years old at this point - since Vulkan fixes many of the perceived flaws with OpenGL.

Obviously, Panda needs to support this. So, I’ve been working on a Vulkan renderer for the past few days. I’ve made some tangible progress:

There’s still a long way to go! Because the API is much more low-level and verbose than OpenGL, it’s going to be a lot of work until we get to the same feature and performance level as our OpenGL back-end. I would welcome any contributions.

Development is happening on the Vulkan branch at GitHub:
github.com/panda3d/panda3d/tree/vulkan

2 Likes

Awesome!

Nice! I can’t wait for what Vulkan can bring us in terms of performance!

It’s great to see this being worked on so soon after the release of Vulkan. Nice :slight_smile:

Hello @rdb,

What state is vulkan support currently at? What kind of priority does it have?

It has only basic functionality right now (it can only render the simplest possible shader). I am working on a new SPIR-V shader pipeline that will bring many benefits, including a working shader pipeline for Vulkan.

That’s great to hear that it’s still being worked on. I was worried about the long time of no commits on the vulkan branch. Is there any specific version that you aim to complete it for?

Thanks for your work!

The work on the shader pipeline is happening on a different branch, which will later be merged into the vulkan branch.

I don’t have any specific targets. It isn’t the highest priority right now, so it probably won’t be in 1.11.

Just a status update (though don’t hold your breath for any of this making it into 1.11):

The work on the new SPIR-V shader pipeline in 1.11 has allowed me to clear a major hurdle, namely, getting arbitrary shaders to work. Over the weekend I’ve finished hooking up the shader pipeline, added descriptor set management and shader input handling. Many shaders (both Cg and GLSL) now work, so samples like Shadows, Bump Mapping and Cartoon Shader now work correctly.

However, there is still a lot of finicky memory management to get right before this can work in larger programs, more work to get feature parity with the OpenGL renderer, and yet more work to do to be able to actually get performance benefits out of using Vulkan.

Anyone who wants to try it can check out and build the vulkan branch from GitHub and set load-display p3vulkandisplay, but beware that many simple things (even using more than a certain amount of textures) will crash, so it’s nowhere near ready for general use.

10 Likes

This is amazing! Thank you very much.