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.
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.
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.
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.
A simple pure python test program utilizing the generated bindings.
pip install pysdl2 pysdl2-dll