Code Monkey home page Code Monkey logo

vulkan-cpp-library's Introduction

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

vulkan-cpp-library's People

Contributors

parawave avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.