-
-
Notifications
You must be signed in to change notification settings - Fork 607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vendor:vulkan]: Missing bind for VK_NULL_HANDLE
#4450
Comments
The way I've alleviated this issue is to add my own context in.
|
Did you bother to check the source code? Handle :: distinct rawptr
NonDispatchableHandle :: distinct u64 https://github.com/odin-lang/Odin/blob/master/vendor/vulkan/core.odin#L21-L22 The basic handles are pointers, whilst the non-dispatchable ones are The problem here is that in C/C++ https://github.com/KhronosGroup/Vulkan-Headers/blob/main/include/vulkan/vulkan_core.h#L29-L60 So on the platforms that have This was part of the compromise I made when making the Vulkan headers. It might be okay to have something like a |
Whilst you're more replying to flysand, I should have answered something similar myself considering I now remember having wondered why there was no So I retract my agreement that there should be a |
Tried to read the documentation on this (emphasis mine):
It seems that
They actually are consistent, according to the docs:
We don't handle these defines in Odin in any way. Also these defines arent meant to be made by the system, at least according to the docs (emphasis again mine):
Which seems to suggest whether non-dispatchable handles are objects or pointers at the end is our choice. So it seems like there would be no problems or consistency issues regarding adding a |
Well it's not really a choice if they are pointers or integers if you want the types to be consistent on a per platform basis. Which is why I chose So the only logical choice would be to do: NULL_HANDLE :: 0 which is still not great because it's just |
Why is it not great? It defines a constant that is present in the vulkan headers |
All handles in vulkan are distinct unsigned 64-bit integers. As a new person to this API, I haven't looked at the underlying types, so whenever a tutorial uses
VK_NULL_HANDLE
, this leaves me guessing that with Odin bindings the corresponding constant is one of the following:vk.NULL_HANDLE
nil
The
nil
doesnt work, because the handles aren't pointers, butNULL_HANDLE
doesn't exist, so all I can do is pass a0
into the function.This has slight effect on readability as I can't tell that the 0 in this case is not some kind of count, but a fence handle.
The text was updated successfully, but these errors were encountered: