Aeva / vk-python

A basic Vulkan ctypes library generator for python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vk-python

This repository provides Vulkan ctypes bindings for Python.

If you are interested in using this library, please keep in mind the following caveats:

  • As this is a pure ctypes implementation of the Vulkan API, it is SLOW.
  • Because there is a significant overhead to each API call, it is recommended that you only use this for cold paths in your program, and implement your hot paths in a C backend or something.
  • This is a work in progress. This has barely been tested at all. Expect things to be broken.
  • Only Windows works at the moment. Linux shouldn't be too hard to get going. I don't have any current plans to support anything else.

vulkan.py

This file is generated by generate.py, and contains the generated ctypes bindings. This is the file you will want to copy into your project. There are no dependencies, beyond Vulkan libraries that should be provided by your drivers.

generate.py

This script reads the API described in the Vulkan API Registry XML file, and uses that information to generate vulkan.py. This script is slow, and is not intended for applications to call directly.

See the Vulkan API Registry Specification for more information on the contents of the Vulkan API Registry XML file.

dependencies

Beautiful soup and LXML are needed by the generator script: pip install beautifulsoup4 lxml

The Vulkan SDK needs to be installed somewhere on your system, and the VULKAN_SDK environment var needs to point to it, such that %VULKAN_SDK%\share\vulkan\registry\vk.xml points to the correct file.

hello_vulkan.py

A simple pure python test program utilizing the generated bindings.

dependencies

pip install pysdl2 pysdl2-dll

About

A basic Vulkan ctypes library generator for python.


Languages

Language:Python 100.0%Language:GLSL 0.0%