Skip to content

Parawave Vulkan C++ is a collection of JUCE modules that extend the application framework by adding the LunarG Vulkan SDK.

License

Notifications You must be signed in to change notification settings

parawave/vulkan-cpp-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Parawave Vulkan C++ is a collection of JUCE modules that extend the application framework by adding the LunarG Vulkan SDK.

The provided modules can be used together with the regular juce_graphics and juce_gui_basics modules to paint hardware accelerated graphics to a native surface.


Important

At the current time the modules are developed and tested on Windows 10 only. Although possible, there is no support for MacOS / iOS / Linux or Android yet. Hopefully this will change. Any help and contribution is appreciated.


Getting Started

Requirements

The code is intended to be used together with the JUCE framework, therefore the same general requirements apply.

Projucer

Add the pw_vulkan and pw_vulkan_graphics modules to your Projucer project.

The modules provided here depend on header and library files of the Vulkan SDK, therefore it's necessary to manually add the include and library directories to your Projucer project. e.g. for version 1.2.170.0 of the SDK, the paths are:

  • Header Search Paths : C:\VulkanSDK\1.2.170.0\Include\
  • Extra Library Search Paths : C:\VulkanSDK\1.2.170.0\Lib

Examples

Attaching a Context

Similar to the juce::OpenGLContext a parawave::VulkanContext can be attached to a juce::Component to activate it for use with juce::Graphics. Alternatively your component could directly extend from parawave::VulkanAppComponent, similar to juce::OpenGLAppComponent.

class MainComponent : public juce::Component
{
public:
    MainComponent()
    {
        context.setDefaultPhysicalDevice(instance);
        context.attachTo(*this);
    }
    
    ~MainComponent() override
    {
        context.detach();
    }
    
    void paint (juce::Graphics& g) override
    {
        // Draw with Vulkan ...
    }

    parawave::VulkanInstance instance;
    parawave::VulkanContext context;
};

Modules

pw_vulkan

This module provides wrapper classes around all major Vulkan vk::Unique... structures to simplify the setup process of Vulkan objects. VulkanDevice for example holds a vk::UniqueDevice (vkDevice) and simplifies the device creation by hiding the device extension selection in the implementation.

There are also a few utility classes for common tasks like memory allocation, image/buffer transfers and fence/semaphore synchronization.

pw_vulkan_graphics

This module depends on pw_vulkan and implements a juce::LowLevelGraphicsContext in VulkanContext similar to juce::OpenGLContext. A VulkanImageType also allows the use of regular juce::Image objects as render target for juce::Graphics operations.


Contribution / What to do!?

How can you contribute and what steps are necessary to get to a production ready state?

  • Add the native surface implementation for MacOS / iOS / Linux and Android.
  • Try to run MoltenVK on MacOS and iOS and simplify the SDK setup process together with the Projucer.
  • Add test cases for common scenarios like swapchain recreation and the frequent recreation of resources.
  • Add documentation.
  • Add examples for the custom setup of a full render pipeline.
  • Add customization to the graphics context for user defined shaders, graphic or compute pipelines.
  • Add compute shaders for hardware accelerated image pixel processing.
  • Improve the performance of the scanline rasterizer implementation of the juce::LowLevelGraphicsContext.

References

About

Parawave Vulkan C++ is a collection of JUCE modules that extend the application framework by adding the LunarG Vulkan SDK.

Topics

Resources

License

Stars

Watchers

Forks