Skip to content
Discussion options

You must be logged in to vote

The Rust type:

pub type PFN_vkVoidFunction = Option<unsafe extern "system" fn()>;

The C type (according to the Vulkan specification):

typedef void (VKAPI_PTR *PFN_vkVoidFunction)(void);

The reason the Rust type is a Option<unsafe extern "system" fn()> instead of just unsafe extern "system" fn() is to allow it to represent null function pointers. C function pointer types implicitly allow null values, but Rust function pointer types do not.

The Rust types for actual Vulkan commands in vulkanalia do not include Option, e.g.:

pub type

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Local-Trash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants