/// <summary> /// /// </summary> /// <param name="pointer"> /// </param> internal unsafe void MarshalTo(SharpVk.Interop.Multivendor.SampleLocationsInfo *pointer) { pointer->SType = StructureType.SampleLocationsInfo; pointer->Next = null; if (this.SampleLocationsPerPixel != null) { pointer->SampleLocationsPerPixel = this.SampleLocationsPerPixel.Value; } else { pointer->SampleLocationsPerPixel = default(SharpVk.SampleCountFlags); } pointer->SampleLocationGridSize = this.SampleLocationGridSize; pointer->SampleLocationsCount = (uint)(Interop.HeapUtil.GetLength(this.SampleLocations)); if (this.SampleLocations != null) { var fieldPointer = (SharpVk.Multivendor.SampleLocation *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Multivendor.SampleLocation>(this.SampleLocations.Length).ToPointer()); for (int index = 0; index < (uint)(this.SampleLocations.Length); index++) { fieldPointer[index] = this.SampleLocations[index]; } pointer->SampleLocations = fieldPointer; } else { pointer->SampleLocations = null; } }
/// <summary> /// /// </summary> /// <param name="extendedHandle"> /// The CommandBuffer handle to extend. /// </param> public static unsafe void SetSampleLocations(this SharpVk.CommandBuffer extendedHandle, SharpVk.Multivendor.SampleLocationsInfo sampleLocationsInfo) { try { CommandCache commandCache = default(CommandCache); SharpVk.Interop.Multivendor.SampleLocationsInfo *marshalledSampleLocationsInfo = default(SharpVk.Interop.Multivendor.SampleLocationsInfo *); commandCache = extendedHandle.commandCache; marshalledSampleLocationsInfo = (SharpVk.Interop.Multivendor.SampleLocationsInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Multivendor.SampleLocationsInfo>()); sampleLocationsInfo.MarshalTo(marshalledSampleLocationsInfo); SharpVk.Interop.Multivendor.VkCommandBufferSetSampleLocationsDelegate commandDelegate = commandCache.Cache.vkCmdSetSampleLocationsEXT; commandDelegate(extendedHandle.handle, marshalledSampleLocationsInfo); } finally { Interop.HeapUtil.FreeAll(); } }