Giter VIP home page Giter VIP logo

vvk's Introduction

VVK

License NuGet Build Status

Low-overhead Vulkan API bindings for .NET 5 and C# 9.

The API provides a low level, nearly one-to-one mapping to the C API, including all of the extension types and functions. Very little infrastructure is built on top of the raw types, except where required by C# (such as function tables). The API uses features new to C# 9 to maximize the performance of the library - namely raw function pointers for faster function calls over unmanaged delegates.

The majority of the API is generated from the vk.xml specification file released by Khronos. A few hand written utility types and extensions are present as well. The library can be easily updated by simply regerating against the latest specification file, and fixing any small issues that may arise with new spec versions. The source code for the generator is in this repo.

A full usage guide, and other notes about the API and generator, can be found on the Wiki.

Contributing

Contributions are welcome, particularly with improvements to the generator and the hand-written components of the bindings.

Updates to new Vulkan spec versions is easy, as long as Khronos doesn't make any changes to their xml spec structure. The primary authors of the library will try to stay on top of new spec versions.

License

The code for the generator and the bindings are under the MIT license.

Quick Usage Guide

This is an abridged version of the usage guide found on the Wiki.

Naming

  • All library types are in the Vulkan namespace.
  • Vulkan API types have unchanged names.
  • All constant values are in the VkConstants static class.
  • Additional utility types are in the Vulkan and Vulkan.VVK namespaces.

Typing

  • All enum and bitmask types are enums in the API.
  • All composite types are structs.
  • Handles are split into two types:
    • VulkanHandle<VkTYPE> for the raw object handles (pointers)
    • VkTYPE for composite handle objects, which hold the handle parent object and related references, in addition to the raw handle. They also have the functions associated with the specific handle type. These are class types.
  • There are special types for native strings (VVK.NativeString) and fixed strings (those extending VVK.IFixedString).
  • All struct types have a static New() function used to setup their fields properly. This is important for "typed" structs (that start with a VkStructureType field), as this sets up their sType field correctly. Struct constructors with parameters will also set the sType field to the correct value. It is important to remember to use New() or a constructor with parameters, or always manually init the type.

Functions

  • Functions are placed into function tables.
  • Functions are loaded with vkGetInstanceProcAddr and vkGetDeviceProcAddr.
  • Functions in the tables take raw pointers, but there are additionally functions in the handle types that take in, ref, and out variables.
  • Global functions are in VkInstance, and InstanceFunctionTable.

vvk's People

Contributors

mossseank avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

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