vulkan-go / vulkan

Vulkan API bindings for Go programming language
MIT License
744 stars 56 forks source link

How heavily does this rely on CGO/C++ bindings? #8

Open ghost opened 6 years ago

ghost commented 6 years ago

Just curious, how close to being pure Go is this project? I see some C files in the repo here but I thought I should ask the devs rather than guess...

xlab commented 6 years ago

@rucuriousyet there are the official C API header files from Khronus https://github.com/vulkan-go/vulkan/tree/master/vulkan

The bindings are generated for them. Vulkan architecture works that way — you have an API to call functions from a shared library, which is a single entrypoint and acts like a facade. I'm talking about libvulkan.so

It's possible to generate Go code from XML spec and call functions from libvulkan without CGo, but Vulkan works with C memory layout, so you will still be responsible for layouts and alignment. Better to hand that to CGo.