FacticiusVir / SharpVk

C# Bindings for the Vulkan API & SPIR-V
MIT License
147 stars 18 forks source link

`SharpVk.Instance.Create` overload parameter disparity with debugging #52

Open Y-Less opened 5 years ago

Y-Less commented 5 years ago

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.

FacticiusVir commented 5 years ago

Good catch - the .partial files have to be manually kept up to date, so I'll add that extension in directly.

Y-Less commented 5 years ago

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.