vulkan-go / vulkan

Vulkan API bindings for Go programming language
MIT License
742 stars 55 forks source link

Add a package with bindings for VulkanMemoryAllocator #31

Closed jclc closed 5 years ago

jclc commented 5 years ago

The Vulkan spec doesn't require the driver to handle memory allocation, leaving the user with the responsibility to deal with the memory management. For most use cases however, the VulkanMemoryAllocator library is sufficient. Would be nice having it included with the Vulkan bindings, perhaps under a subpackage called vma.

jclc commented 5 years ago

I have some preliminary work done at https://github.com/jclc/vulkan/tree/vma. This might be a little tricky since while the header defines the interface in C, the implementation is in C++.

xlab commented 5 years ago

@jclc what do you think about separating this into standalone repo? E.g. https://github.com/vulkan-go/vma The project is too big to add side-projects in the root..

Also, no need to fork.

jclc commented 5 years ago

Probably a good idea. I'm still studying how to use c-for-go. One question I have is how to make vma use the Vulkan types from this repository? Will that require some post-processing that adds an import to the file and replaces all identifiers beginning with Vk with vk., or can it be done directly in the generator?

xlab commented 5 years ago

@jclc usually by hand, using helpers that accept unsafe.Pointerss and wrap it in the "local" type. Need some examples..

jclc commented 5 years ago

There are now (mostly) functional bindings at https://github.com/vulkan-go/vma