SharpVk
SharpVk copied to clipboard
`SharpVk.Instance.Create` overload parameter disparity with debugging
The .gen version of SharpVk.Instance.Create has the following prototype:
public static unsafe SharpVk.Instance Create(CommandCache commandCache, ArrayProxy<string>? enabledLayerNames, ArrayProxy<string>? enabledExtensionNames, SharpVk.InstanceCreateFlags? flags = default(SharpVk.InstanceCreateFlags?), SharpVk.ApplicationInfo? applicationInfo = default(SharpVk.ApplicationInfo?), SharpVk.Multivendor.DebugReportCallbackCreateInfo? debugReportCallbackCreateInfoExt = null, SharpVk.Multivendor.ValidationFlags? validationFlagsExt = null, SharpVk.Multivendor.DebugUtilsMessengerCreateInfo? debugUtilsMessengerCreateInfoExt = null, SharpVk.AllocationCallbacks? allocator = default(SharpVk.AllocationCallbacks?))
But the .partial version has:
public static unsafe SharpVk.Instance Create(ArrayProxy<string>? enabledLayerNames, ArrayProxy<string>? enabledExtensionNames, SharpVk.InstanceCreateFlags? flags = null, SharpVk.ApplicationInfo? applicationInfo = null, SharpVk.Multivendor.DebugReportCallbackCreateInfo? debugReportCallbackCreateInfoExt = null, SharpVk.Multivendor.ValidationFlags? validationFlagsExt = null, AllocationCallbacks? allocator = null)
I would expect the only difference to be the presence of CommandCache, but the former also has:
SharpVk.Multivendor.DebugUtilsMessengerCreateInfo? debugUtilsMessengerCreateInfoExt = null
While the latter doesn't. This means you can't, using that factory, create an instance with the new debugging framework rather than then old one.
Good catch - the .partial files have to be manually kept up to date, so I'll add that extension in directly.
Ahh, that explains another thing I was wondering about - why some places used default(T?) and others used null. It makes sense you'd use the more generic version in generated code and the shorter version in manual code.