/// <summary> /// /// </summary> /// <param name="extendedHandle"> /// The PhysicalDevice handle to extend. /// </param> public static unsafe SharpVk.Khronos.SurfaceCapabilities2 GetSurfaceCapabilities2(this SharpVk.PhysicalDevice extendedHandle, SharpVk.Khronos.PhysicalDeviceSurfaceInfo2 surfaceInfo) { try { SharpVk.Khronos.SurfaceCapabilities2 result = default(SharpVk.Khronos.SurfaceCapabilities2); CommandCache commandCache = default(CommandCache); SharpVk.Interop.Khronos.PhysicalDeviceSurfaceInfo2 *marshalledSurfaceInfo = default(SharpVk.Interop.Khronos.PhysicalDeviceSurfaceInfo2 *); SharpVk.Interop.Khronos.SurfaceCapabilities2 marshalledSurfaceCapabilities = default(SharpVk.Interop.Khronos.SurfaceCapabilities2); commandCache = extendedHandle.commandCache; marshalledSurfaceInfo = (SharpVk.Interop.Khronos.PhysicalDeviceSurfaceInfo2 *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.PhysicalDeviceSurfaceInfo2>()); surfaceInfo.MarshalTo(marshalledSurfaceInfo); SharpVk.Interop.Khronos.VkPhysicalDeviceGetSurfaceCapabilities2Delegate commandDelegate = commandCache.Cache.vkGetPhysicalDeviceSurfaceCapabilities2KHR; Result methodResult = commandDelegate(extendedHandle.handle, marshalledSurfaceInfo, &marshalledSurfaceCapabilities); if (SharpVkException.IsError(methodResult)) { throw SharpVkException.Create(methodResult); } result = SharpVk.Khronos.SurfaceCapabilities2.MarshalFrom(&marshalledSurfaceCapabilities); return(result); } finally { Interop.HeapUtil.FreeAll(); } }
/// <summary> /// /// </summary> internal static unsafe PhysicalDeviceSurfaceInfo2 MarshalFrom(SharpVk.Interop.Khronos.PhysicalDeviceSurfaceInfo2 *pointer) { PhysicalDeviceSurfaceInfo2 result = default(PhysicalDeviceSurfaceInfo2); result.Surface = new SharpVk.Khronos.Surface(default(SharpVk.Instance), pointer->Surface); return(result); }
/// <summary> /// Query device group present capabilities for a surface /// </summary> /// <param name="extendedHandle"> /// The Device handle to extend. /// </param> /// <param name="surfaceInfo"> /// An instance of the VkPhysicalDeviceSurfaceInfo2KHR structure, /// describing the surface and other fixed parameters that would be /// consumed by vkCreateSwapchainKHR. /// </param> public static unsafe SharpVk.Khronos.DeviceGroupPresentModeFlags GetGroupSurfacePresentModes2(this SharpVk.Device extendedHandle, SharpVk.Khronos.PhysicalDeviceSurfaceInfo2 surfaceInfo) { try { SharpVk.Khronos.DeviceGroupPresentModeFlags result = default(SharpVk.Khronos.DeviceGroupPresentModeFlags); CommandCache commandCache = default(CommandCache); SharpVk.Interop.Khronos.PhysicalDeviceSurfaceInfo2 *marshalledSurfaceInfo = default(SharpVk.Interop.Khronos.PhysicalDeviceSurfaceInfo2 *); SharpVk.Khronos.DeviceGroupPresentModeFlags marshalledModes = default(SharpVk.Khronos.DeviceGroupPresentModeFlags); commandCache = extendedHandle.commandCache; marshalledSurfaceInfo = (SharpVk.Interop.Khronos.PhysicalDeviceSurfaceInfo2 *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.PhysicalDeviceSurfaceInfo2>()); surfaceInfo.MarshalTo(marshalledSurfaceInfo); SharpVk.Interop.Multivendor.VkDeviceGetGroupSurfacePresentModes2Delegate commandDelegate = commandCache.Cache.vkGetDeviceGroupSurfacePresentModes2EXT; Result methodResult = commandDelegate(extendedHandle.handle, marshalledSurfaceInfo, &marshalledModes); if (SharpVkException.IsError(methodResult)) { throw SharpVkException.Create(methodResult); } result = marshalledModes; return(result); } finally { Interop.HeapUtil.FreeAll(); } }
/// <summary> /// /// </summary> /// <param name="extendedHandle"> /// The PhysicalDevice handle to extend. /// </param> public static unsafe SharpVk.Khronos.SurfaceFormat2[] GetSurfaceFormats2(this SharpVk.PhysicalDevice extendedHandle, SharpVk.Khronos.PhysicalDeviceSurfaceInfo2 surfaceInfo) { try { SharpVk.Khronos.SurfaceFormat2[] result = default(SharpVk.Khronos.SurfaceFormat2[]); uint marshalledSurfaceFormatCount = default(uint); CommandCache commandCache = default(CommandCache); SharpVk.Interop.Khronos.PhysicalDeviceSurfaceInfo2 *marshalledSurfaceInfo = default(SharpVk.Interop.Khronos.PhysicalDeviceSurfaceInfo2 *); SharpVk.Interop.Khronos.SurfaceFormat2 * marshalledSurfaceFormats = default(SharpVk.Interop.Khronos.SurfaceFormat2 *); commandCache = extendedHandle.commandCache; marshalledSurfaceInfo = (SharpVk.Interop.Khronos.PhysicalDeviceSurfaceInfo2 *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.PhysicalDeviceSurfaceInfo2>()); surfaceInfo.MarshalTo(marshalledSurfaceInfo); SharpVk.Interop.Khronos.VkPhysicalDeviceGetSurfaceFormats2Delegate commandDelegate = commandCache.Cache.vkGetPhysicalDeviceSurfaceFormats2KHR; Result methodResult = commandDelegate(extendedHandle.handle, marshalledSurfaceInfo, &marshalledSurfaceFormatCount, marshalledSurfaceFormats); if (SharpVkException.IsError(methodResult)) { throw SharpVkException.Create(methodResult); } marshalledSurfaceFormats = (SharpVk.Interop.Khronos.SurfaceFormat2 *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.SurfaceFormat2>((uint)(marshalledSurfaceFormatCount))); commandDelegate(extendedHandle.handle, marshalledSurfaceInfo, &marshalledSurfaceFormatCount, marshalledSurfaceFormats); if (marshalledSurfaceFormats != null) { var fieldPointer = new SharpVk.Khronos.SurfaceFormat2[(uint)(marshalledSurfaceFormatCount)]; for (int index = 0; index < (uint)(marshalledSurfaceFormatCount); index++) { fieldPointer[index] = SharpVk.Khronos.SurfaceFormat2.MarshalFrom(&marshalledSurfaceFormats[index]); } result = fieldPointer; } else { result = null; } return(result); } finally { Interop.HeapUtil.FreeAll(); } }
/// <summary> /// /// </summary> internal unsafe void MarshalTo(SharpVk.Interop.Khronos.PhysicalDeviceSurfaceInfo2 *pointer) { pointer->SType = StructureType.PhysicalDeviceSurfaceInfo2; pointer->Next = null; pointer->Surface = this.Surface?.handle ?? default(SharpVk.Interop.Khronos.Surface); }