@@ -156,8 +156,47 @@ This mod should be positioned at the start of the mod order, after `AddIncludes`
156156
157157Mod categories: Creation
158158
159+ This mod adds empty structs for missing types that are identified to be used as handle types. To be a handle type, the
160+ type must only be ever referenced through a pointer. After the empty struct representing the handle type is extracted,
161+ ` TransformHandles ` can then be used to transform the pointer to be wrapped within the handle struct.
162+
163+ Side note: This mod is similar to ` AddOpaqueStructs ` in that it adds empty structs, but ` ExtractHandles ` has a much more
164+ automated approach since it deals specifically with handle types that are referenced using pointers.
165+
166+ This code has been manually trimmed for the sake of example and comes from the state of the Vulkan bindings before
167+ ` ExtractHandles ` executes. In this case, ` VkInstance_T ` will be identified as a missing handle type and an empty struct
168+ will be added for it. On the other hand, ` VkInstanceCreateInfo ` and ` VkAllocationCallbacks ` will not be affected since
169+ they already exist. Similarly, ` VkResult ` is not affected because it is not referenced through a pointer.
170+ ``` cs
171+ public struct VkAllocationCallbacks ;
172+ public struct VkInstanceCreateInfo ;
173+
174+ public class Vk
175+ {
176+ public static extern VkResult vkCreateInstance (
177+ VkInstanceCreateInfo* pCreateInfo,
178+ VkAllocationCallbacks* pAllocator,
179+ VkInstance_T** pInstance
180+ );
181+ }
182+ ```
183+
184+ The result of running ` ExtractHandles ` on the above code will lead to the creation of a new type:
185+ ``` cs
186+ public unsafe partial struct VkInstance_T
187+ {
188+ }
189+ ```
190+
159191Usage recommendations:
160192
193+ This mod should be used if a set of bindings contains types referenced only through pointers and those pointers are
194+ missing from the final set of generated bindings.
195+
196+ Furthermore, this mod should be used alongside ` TransformHandles ` so that the handles are transformed into a more
197+ user-friendly version. ` ExtractHandles ` should be positioned before ` TransformHandles ` and any other mods that might use
198+ its results in the mod order.
199+
161200### ExtractNestedTyping
162201
163202Mod categories: Creation
0 commit comments