colonelthirtytwo / dvulkan Goto Github PK
View Code? Open in Web Editor NEWAuto-generated D bindings for Vulkan
Auto-generated D bindings for Vulkan
Check out DerelictGL3 or DerelictGLFW, global enums all over the place. I strongly recommend to remove this behavior, this deviates unnecessarily from the original. You could alias VkResult as int, its nothing else in the vulkan.h header.
I read Manuzor's pull request, I disagree with his point, but think if it is an optional feature it would be ok. However, the bindings you ship with this repo should be as close as possible to the original.
In any case, thanks for the awesome work.
See also KhronosGroup/Vulkan-Docs#814
Working with multiple devices in Vulkan requires either using the dynamically dispatching functions loaded with vkGetInstanceProcAddr
or by loading separate sets of device-specific functions using vkGetDeviceProcAddr
and storing them individually.
d-vulkan supports the former, but not the latter as functions are loaded globally.
It doesn't appear possible to portably implement VK_NULL_HANDLE
in D at this time, so it should be discouraged.
The main issue is that on 32-bit platforms, VK_NULL_HANDLE
must be both a null pointer (for dispatchable types like VkDevice
, which are pointers) and zero (for non-dispatchable types like VkFence
, which are 64-bit integers). Vulkan defines VK_NULL_HANDLE
to 0, which works in C because in C, zero is implicitly convertible to the null pointer. However, in D, it is not; trying to convert 0 to a pointer without a cast results in a type error.
As an alternative, I will provide VK_NULL_DISPATCHABLE_HANDLE
and VK_NULL_NONDISPATCHABLE_HANDLE
. The value Vk(Type).init
will also work (and works now). VK_NULL_HANDLE
will be marked as deprecated with a message to the developer.
Allocation callbacks may theoretically use the GC (ex. if using the default thisAllocator
), so Vulkan functions in theory can use the GC.
They will remain nothrow
, as throwing exceptions across unknown C code will likely break many things.
Please change the defintion to
enum VK_NULL_HANDLE = null;
in vkdgen.py, line 60 (was = 0 before), so that we don't get type errors when doing tests like physicalDevice == VK_NULL_HANDLE
.
Otherwise DVulkanLoader.loadAllFunctions(device) does not work because of missing this pointer.
Add bindings for the Vulkan platform extensions.
I don't have a Vulkan installation on Linux at the moment, so I don't know the Vulkan library name on Linux (or Mac, if Vulkan even exists there).
If someone knows, please leave a comment.
After creating an instance and calling DVulkanLoader.loadAllFunctions(instance)
initializes vkDestroyInstance
just fine, using vkGetInstanceProcAddr(instance, "vkDestroyInstance")
internally.
But when creating a device and calling DVulkanLoader.loadAllFunctions(device)
, the function internally calls vkGetDeviceProcAddr(device, "vkDestroyInstance")
which returns null and thus resets vkDestroyInstance
to null.
Is that a vulkan implementation error, or should we just not use vkGetDeviceProcAddr
to retrieve vkDestroyInstance
? I couldn't find any list which functions should be loaded with any of the two loader functions.
To cut down on loading times, extension functions and structures should be put in version
statements, so that the developer can specify which extension functions that their project actually uses and needs to be loaded versus functions that will never be used and can be skipped.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.