using System; using System.Collections.Generic; namespace Avalonia.Vulkan; public class VulkanOptions { public VulkanInstanceCreationOptions VulkanInstanceCreationOptions { get; set; } = new(); public VulkanDeviceCreationOptions VulkanDeviceCreationOptions { get; set; } = new(); public IVulkanDevice? CustomSharedDevice { get; set; } } public class VulkanInstanceCreationOptions { public VkGetInstanceProcAddressDelegate? CustomGetProcAddressDelegate { get; set; } /// /// Sets the application name of the vulkan instance /// public string? ApplicationName { get; set; } /// /// Specifies the vulkan api version to use /// public Version VulkanVersion{ get; set; } = new Version(1, 1, 0); /// /// Specifies additional extensions to enable if available on the instance /// public IList InstanceExtensions { get; set; } = new List(); /// /// Specifies layers to enable if available on the instance /// public IList EnabledLayers { get; set; } = new List(); /// /// Enables the debug layer /// public bool UseDebug { get; set; } /* /// /// Sets the presentation mode the swapchain uses if available. /// //public PresentMode PresentMode { get; set; } = PresentMode.Mailbox;*/ } public class VulkanDeviceCreationOptions { /// /// Specifies extensions to enable if available on the logical device /// public IList DeviceExtensions { get; set; } = new List(); /// /// Selects the first suitable discrete gpu available /// public bool PreferDiscreteGpu { get; set; } public bool RequireComputeBit { get; set; } } public class VulkanPlatformSpecificOptions { public IList RequiredInstanceExtensions { get; set; } = new List(); public VkGetInstanceProcAddressDelegate? GetProcAddressDelegate { get; set; } public Func? DeviceCheckSurfaceFactory { get; set; } public Dictionary PlatformFeatures { get; set; } = new(); } public delegate IntPtr VkGetInstanceProcAddressDelegate(IntPtr instance, string name);