KhronosGroup / KhronosGroup/Vulkan-Docs
XML Registry: specify optional (nullable) parameters in PFN_vkReallocationFunction typedef (and others)
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 549
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 2
Description
In `xml/vk.xml`, the property `optional` can be used on a tag to represent that a pointer is nullable. However, in some cases, this is not done properly. Specifically, in the typedefs for certain allocation functions - such as `PFN_vkReallocationFunction` and `PFN_vkFreeFunction` - there is no property to specify that `pOriginal`/`pMemory` is nullable. This can cause issues when generating bindings to certain languages; for instance, I came across this issue when trying to write a custom allocator with https://github.com/Snektron/vulkan-zig, and it resulted in me needing to do some unsafe function pointer casts as a workaround.
It would be useful if this `optional` property could be, for instance, added to the `` tag for the arguments of these functions.
Note that I'm sure there are more typedefs with this issue, as none of them seem to use `optional` at all; this is just the one I personally have run into.
Contributor guide
Assessment
This issue has not been assessed yet.