/// <summary> /// /// </summary> internal static unsafe SparseImageFormatProperties2 MarshalFrom(SharpVk.Interop.Khronos.SparseImageFormatProperties2 *pointer) { SparseImageFormatProperties2 result = default(SparseImageFormatProperties2); result.Properties = pointer->Properties; return(result); }
/// <summary> /// /// </summary> public static unsafe SharpVk.Khronos.SparseImageFormatProperties2[] GetSparseImageFormatProperties2(this SharpVk.PhysicalDevice extendedHandle, SharpVk.Khronos.PhysicalDeviceSparseImageFormatInfo2 formatInfo) { try { SharpVk.Khronos.SparseImageFormatProperties2[] result = default(SharpVk.Khronos.SparseImageFormatProperties2[]); uint propertyCount = default(uint); CommandCache commandCache = default(CommandCache); SharpVk.Interop.Khronos.PhysicalDeviceSparseImageFormatInfo2 *marshalledFormatInfo = default(SharpVk.Interop.Khronos.PhysicalDeviceSparseImageFormatInfo2 *); SharpVk.Interop.Khronos.SparseImageFormatProperties2 * marshalledProperties = default(SharpVk.Interop.Khronos.SparseImageFormatProperties2 *); commandCache = extendedHandle.commandCache; marshalledFormatInfo = (SharpVk.Interop.Khronos.PhysicalDeviceSparseImageFormatInfo2 *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.PhysicalDeviceSparseImageFormatInfo2>()); formatInfo.MarshalTo(marshalledFormatInfo); SharpVk.Interop.Khronos.VkPhysicalDeviceGetSparseImageFormatProperties2Delegate commandDelegate = commandCache.GetCommandDelegate <SharpVk.Interop.Khronos.VkPhysicalDeviceGetSparseImageFormatProperties2Delegate>("vkGetPhysicalDeviceSparseImageFormatProperties2KHR", "instance"); commandDelegate(extendedHandle.handle, marshalledFormatInfo, &propertyCount, marshalledProperties); marshalledProperties = (SharpVk.Interop.Khronos.SparseImageFormatProperties2 *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.SparseImageFormatProperties2>((uint)(propertyCount))); commandDelegate(extendedHandle.handle, marshalledFormatInfo, &propertyCount, marshalledProperties); if (marshalledProperties != null) { var fieldPointer = new SharpVk.Khronos.SparseImageFormatProperties2[(uint)(propertyCount)]; for (int index = 0; index < (uint)(propertyCount); index++) { fieldPointer[index] = SharpVk.Khronos.SparseImageFormatProperties2.MarshalFrom(&marshalledProperties[index]); } result = fieldPointer; } else { result = null; } return(result); } finally { Interop.HeapUtil.FreeAll(); } }