A new Vulkan wrapper
Like you may know, I wrote a Vulkan wrapper CVulkan, which is pretty good since I use it in my Vulk Engine. Recently, I had to implement a new feature in Vulk: detect when the window is resized and reload all Vulkan pipelines. Sadly, CVulkan was bugged. So I came back to the code, and I had to remember architecture of this complex C code generator. But instead of suffer in silence, I thought: no way, it’s too dificult to maintain. vulkan was on its way, a new shiny CFFI Vulkan wrapper. But first of all,
What is CFFI ?
CFFI is a Python module aimed at simplify communication with C API. It’s a beautiful jewel written by the PyPy community. CFFI handles all the Python to C conversion, the memory managemement, all these tricky parts.
The new wrapper is named just vulkan, because on pypi, the module is named just vulkan, which allows a simple
pip install vulkan.
This wrapper works like CVulkan, by parsing the
vk.xml file but, instead of generating a C file, it generates a Python file (thanks to CFFI).
Go take a look : https://github.com/realitix/vulkan
Let me know what you think of this article on twitter @realitix!