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

3 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.

11 Likes

This is amazing! Thank you very much.

I apologize for the necropost, seeing as this thread has been dead for four years, but I feel like this is important to ask given that the documentation for the latest Panda versions still says the most supported API is OpenGL right now. How is this coming along? Anything that could use some help? I see new commits still being pushed so that’s good.

As DirectX isn’t as portable this Vulkan branch seems like the closest thing we’d have to more modern features in the graphics pipeline. There’s a gap in the market for FOSS game engines that expose everything modern proprietary engines do. I took a look at OGRE Next and they’re still on D3D11.

I wouldn’t consider that a necropost; this is the right place to post this.

It’s still been receiving updates, but it’s just a pet project of mine and not a top priority. Note that it won’t really have any significant outwardly visible effects on the engine (other than perhaps performance improvements for select applications) since it just affects the way Panda communicates with the graphics card, not really the set of functionality that is exposed.

The difference between D3D11 and D3D12 is similar to the difference between OpenGL and Vulkan in that barely any new functionality is exposed, it’s just a different API sitting at a different level of abstraction.

With that in mind, the focus is on finishing the shader pipeline, which will benefit the Vulkan efforts as well. The Vulkan renderer will therefore be unlikely to be in the next major release of Panda.

3 Likes