Giter VIP home page Giter VIP logo

vkroots's Introduction

vkroots logo

What is vkroots?

vkroots is a framework for writing Vulkan layers that takes all the complexity/hastle away from you! It's so simple!

Example

vkroots is incredibly easy to integrate into your project, it's a single #include, and even supports defining multiple layers in a single shared library with VKROOTS_NEGOTIATION_INTERFACE.

All you do is just implement the functions you want, and they are automagically hooked using C++20 concepts magic! Just watch:

#include "vkroots.h"

#include <cstdio>

namespace MyLayer {

  class VkDeviceOverrides {
  public:
    static VkResult CreateImage(
      const vkroots::VkDeviceDispatch* pDispatch,
            VkDevice                   device,
      const VkImageCreateInfo*         pCreateInfo,
      const VkAllocationCallbacks*     pAllocator,
            VkImage*                   pImage) {
      printf("The app has made an image, I bet it's going to be frogtastically beautiful!\n");
      return pDispatch->CreateImage(device, pCreateInfo, pAllocator, pImage);
    }
  };

}

VKROOTS_DEFINE_LAYER_INTERFACES(vkroots::NoOverrides,
                                vkroots::NoOverrides,
                                MyLayer::VkDeviceOverrides);

How do I pull this into my project?

You can either add this repo as a git submodule, copy the header from this repo directly, or generate it yourself with gen/make_vkroots.

The vkroots header can be generated from any Vulkan Registry XML (even for unreleased/non-standard extensions). This was used, for example, in the sample VK_FOOL_printed_surface implementation using CUPS.

Dependencies

There are no dependencies other a C++20-capable compiler.

If you wish to generate the vkroots.h header from a Vulkan Registry XML, you will need Python 3.

Contributing

If you find any issues with the project or have any feature requests, please feel free to make an issue or a pull request.

Projects using vkroots

License

The python generator scripts: gen/make_vkroots, gen/vulkan_helpers.py, are licensed under LGPL v2.1 as they take a bunch of code from WineVulkan, see the header of make_vkroots and vulkan_helpers.py for more verbose license info.

Everything else, vkroots.h header, other intermediate headers (inc), and samples are licensed under Apache-2.0 OR MIT to be compatible with the Vulkan Registry XML.

See the top of associated files for more information.

Happy Layering! 🐸✨

vkroots's People

Contributors

joshua-ashton avatar

Watchers

 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.