Ejemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="extendedHandle">
 /// The Device handle to extend.
 /// </param>
 /// <param name="timestampInfos">
 /// </param>
 /// <param name="timestamps">
 /// </param>
 public static unsafe ulong GetCalibratedTimestamps(this SharpVk.Device extendedHandle, ArrayProxy <SharpVk.Multivendor.CalibratedTimestampInfo>?timestampInfos, ArrayProxy <ulong>?timestamps)
 {
     try
     {
         ulong        result       = default(ulong);
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Multivendor.CalibratedTimestampInfo *marshalledTimestampInfos = default(SharpVk.Interop.Multivendor.CalibratedTimestampInfo *);
         ulong *marshalledTimestamps   = default(ulong *);
         ulong  marshalledMaxDeviation = default(ulong);
         commandCache = extendedHandle.commandCache;
         if (timestampInfos.IsNull())
         {
             marshalledTimestampInfos = null;
         }
         else
         {
             if (timestampInfos.Value.Contents == ProxyContents.Single)
             {
                 marshalledTimestampInfos = (SharpVk.Interop.Multivendor.CalibratedTimestampInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Multivendor.CalibratedTimestampInfo>());
                 timestampInfos.Value.GetSingleValue().MarshalTo(&*(SharpVk.Interop.Multivendor.CalibratedTimestampInfo *)(marshalledTimestampInfos));
             }
             else
             {
                 var fieldPointer = (SharpVk.Interop.Multivendor.CalibratedTimestampInfo *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.Multivendor.CalibratedTimestampInfo>(Interop.HeapUtil.GetLength(timestampInfos.Value)).ToPointer());
                 for (int index = 0; index < (uint)(Interop.HeapUtil.GetLength(timestampInfos.Value)); index++)
                 {
                     timestampInfos.Value[index].MarshalTo(&fieldPointer[index]);
                 }
                 marshalledTimestampInfos = fieldPointer;
             }
         }
         if (timestamps.IsNull())
         {
             marshalledTimestamps = null;
         }
         else
         {
             if (timestamps.Value.Contents == ProxyContents.Single)
             {
                 marshalledTimestamps             = (ulong *)(Interop.HeapUtil.Allocate <ulong>());
                 *(ulong *)(marshalledTimestamps) = timestamps.Value.GetSingleValue();
             }
             else
             {
                 var fieldPointer = (ulong *)(Interop.HeapUtil.AllocateAndClear <ulong>(Interop.HeapUtil.GetLength(timestamps.Value)).ToPointer());
                 for (int index = 0; index < (uint)(Interop.HeapUtil.GetLength(timestamps.Value)); index++)
                 {
                     fieldPointer[index] = timestamps.Value[index];
                 }
                 marshalledTimestamps = fieldPointer;
             }
         }
         SharpVk.Interop.Multivendor.VkDeviceGetCalibratedTimestampsDelegate commandDelegate = commandCache.Cache.vkGetCalibratedTimestampsEXT;
         Result methodResult = commandDelegate(extendedHandle.handle, (uint)(Interop.HeapUtil.GetLength(timestampInfos)), marshalledTimestampInfos, marshalledTimestamps, &marshalledMaxDeviation);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
         result = marshalledMaxDeviation;
         return(result);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
 /// <summary>
 ///
 /// </summary>
 internal unsafe void MarshalTo(SharpVk.Interop.Multivendor.CalibratedTimestampInfo *pointer)
 {
     pointer->SType      = StructureType.CalibratedTimestampInfo;
     pointer->Next       = null;
     pointer->TimeDomain = this.TimeDomain;
 }