/// <summary> /// /// </summary> internal unsafe void MarshalTo(SharpVk.Interop.Khronos.PhysicalDeviceSparseImageFormatInfo2 *pointer) { pointer->SType = StructureType.PhysicalDeviceSparseImageFormatInfo2Khr; pointer->Next = null; pointer->Format = this.Format; pointer->Type = this.Type; pointer->Samples = this.Samples; pointer->Usage = this.Usage; pointer->Tiling = this.Tiling; }
/// <summary> /// /// </summary> internal static unsafe PhysicalDeviceSparseImageFormatInfo2 MarshalFrom(SharpVk.Interop.Khronos.PhysicalDeviceSparseImageFormatInfo2 *pointer) { PhysicalDeviceSparseImageFormatInfo2 result = default(PhysicalDeviceSparseImageFormatInfo2); result.Format = pointer->Format; result.Type = pointer->Type; result.Samples = pointer->Samples; result.Usage = pointer->Usage; result.Tiling = pointer->Tiling; 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(); } }