Skip to content

Add function types and function pointer types for callbacks.#294

Open
Kerilk wants to merge 1 commit intoKhronosGroup:mainfrom
Kerilk:callback-types
Open

Add function types and function pointer types for callbacks.#294
Kerilk wants to merge 1 commit intoKhronosGroup:mainfrom
Kerilk:callback-types

Conversation

@Kerilk
Copy link
Copy Markdown
Contributor

@Kerilk Kerilk commented Oct 7, 2025

This would be a solution to provide KhronosGroup/OpenCL-Docs#947 without update to the XML.

@oddhack
Copy link
Copy Markdown
Contributor

oddhack commented Apr 7, 2026

I saw this go by on the CL agenda and will note that in Vulkan XML, we declare function pointer types using the same XML syntax as command tags, then refer to them like any other type, e.g.

<type category="funcpointer">
    <proto><type>void</type> <name>PFN_vkInternalAllocationNotification</name></proto>
    <param><type>void</type>* <name>pUserData</name></param>
</type>
<type category="struct" name="VkAllocationCallbacks">
    <member><type>void</type>* <name>pUserData</name></member>
    <member><type>PFN_vkInternalAllocationNotification</type> <name>pfnInternalAllocation</name></member>
</type>

This makes the type information as accessible as any other struct / command parameter type and re-uses the existing header generation code (but CL might need to do something else, as I don't think you're using the Vulkan script infrastructure for some of your targets).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants