realitix / vulkan

The ultimate Python binding for Vulkan API
Apache License 2.0
505 stars 46 forks source link

Question about _wrap functions #52

Closed apenngrace closed 5 years ago

apenngrace commented 6 years ago

I see that certain functions are only defined with a _wrap prefix, such as vkGetPhysicalDeviceSurfaceSupportKHR. It looks like such functions require a call to vkGetInstanceProcAddr or vkGetDeviceProcAddr in order to get a function pointer.

I'm wondering why certain functions are defined with _wrap and others aren't.

Thanks.

realitix commented 6 years ago

Hello @apenngrace, Indeed some functions require a call to vkGetDeviceProcAddr, extension functions. Some functions don't need this call and are exposed directly by the SDK. That's the reason.

apenngrace commented 6 years ago

Could you clarify the circumstances for when the call is needed?

I’m wondering, are these functions only defined if certain extensions are enabled or something?

On Oct 12, 2018, at 9:16 AM, Jean-Sébastien B. notifications@github.com wrote:

Hello @apenngrace, Indeed some functions require a call to vkGetDeviceProcAddr, extension functions. Some functions don't need this call and are exposed directly by the SDK. That's the reason.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

realitix commented 5 years ago

Hello @apenngrace. Sorry for my late reply, extensions function are not guaranteed to be present because they are extensions like the KHR functions for example. To enable it, you have to add the extension when you create the device and you must have a driver that support it.

I hope it answers to your question.