using System.Runtime.Versioning; namespace Brutal.VulkanApi.Wayland { public static unsafe partial class WaylandExtensions { /// /// vkCreateWaylandSurfaceKHR - Create a <c>VkSurfaceKHR</c> object for a Wayland window /// /// /// /// :refpage: vkCreateWaylandSurfaceKHR /// /// /// To create a VkSurfaceKHR object for a Wayland surface, call: /// /// /// // Provided by VK_KHR_wayland_surface /// VkResult vkCreateWaylandSurfaceKHR( /// VkInstance instance, /// const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, /// const VkAllocationCallbacks* pAllocator, /// VkSurfaceKHR* pSurface); /// /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [SupportedOSPlatform("linux")] public static unsafe void CreateWaylandSurfaceKHR( this VulkanHandleWrapper handle, in VkWaylandSurfaceCreateInfoKHR pCreateInfo, VkAllocator? pAllocator, out VkSurfaceKHR pSurface ) { fixed (VkWaylandSurfaceCreateInfoKHR* pCreateInfoFixed = &pCreateInfo) { VkSurfaceKHR pSurfaceLocal = default; VkResult result = handle.PInvoke.vkCreateWaylandSurfaceKHR.Invoke( handle.Handle, pCreateInfoFixed, pAllocator, &pSurfaceLocal ); switch (result) { case VkResult.ErrorOutOfHostMemory: throw new VkResultError( VkResult.ErrorOutOfHostMemory, "Vulkan call to vkCreateWaylandSurfaceKHR failed with error: VK_ERROR_OUT_OF_HOST_MEMORY" ); case VkResult.ErrorOutOfDeviceMemory: throw new VkResultError( VkResult.ErrorOutOfDeviceMemory, "Vulkan call to vkCreateWaylandSurfaceKHR failed with error: VK_ERROR_OUT_OF_DEVICE_MEMORY" ); case VkResult.ErrorUnknown: throw new VkResultError( VkResult.ErrorUnknown, "Vulkan call to vkCreateWaylandSurfaceKHR failed with error: VK_ERROR_UNKNOWN" ); case VkResult.ErrorValidationFailed: throw new VkResultError( VkResult.ErrorValidationFailed, "Vulkan call to vkCreateWaylandSurfaceKHR failed with error: VK_ERROR_VALIDATION_FAILED" ); case VkResult.Success: default: break; } pSurface = pSurfaceLocal; } } /// /// vkGetPhysicalDeviceWaylandPresentationSupportKHR - Query physical device for presentation to Wayland /// /// /// /// To determine whether a queue family of a physical device supports /// presentation to a Wayland compositor, call: /// /// /// // Provided by VK_KHR_wayland_surface /// VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR( /// VkPhysicalDevice physicalDevice, /// uint32_t queueFamilyIndex, /// struct wl_display* display); /// /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [SupportedOSPlatform("linux")] public static unsafe Brutal.Bool32 GetWaylandPresentationSupportKHR( this VulkanHandleWrapper handle, int queueFamilyIndex, void* display ) { return handle.PInvoke.vkGetPhysicalDeviceWaylandPresentationSupportKHR.Invoke( handle.Handle, queueFamilyIndex, display ); } } }