Esempio n. 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="extendedHandle">
 /// The Device handle to extend.
 /// </param>
 /// <param name="info">
 /// </param>
 /// <param name="buffer">
 /// </param>
 public static unsafe void GetMemoryAndroidHardwareBuffer(this SharpVk.Device extendedHandle, SharpVk.Android.MemoryGetAndroidHardwareBufferInfo info, IntPtr buffer)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Android.MemoryGetAndroidHardwareBufferInfo *marshalledInfo = default(SharpVk.Interop.Android.MemoryGetAndroidHardwareBufferInfo *);
         IntPtr *marshalledBuffer = default(IntPtr *);
         commandCache   = extendedHandle.commandCache;
         marshalledInfo = (SharpVk.Interop.Android.MemoryGetAndroidHardwareBufferInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Android.MemoryGetAndroidHardwareBufferInfo>());
         info.MarshalTo(marshalledInfo);
         marshalledBuffer = (IntPtr *)(Interop.HeapUtil.Allocate <IntPtr>());
         *marshalledBuffer = buffer;
         SharpVk.Interop.Android.VkDeviceGetMemoryAndroidHardwareBufferDelegate commandDelegate = commandCache.Cache.vkGetMemoryAndroidHardwareBufferANDROID;
         Result methodResult = commandDelegate(extendedHandle.handle, marshalledInfo, marshalledBuffer);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
 /// <summary>
 ///
 /// </summary>
 internal unsafe void MarshalTo(SharpVk.Interop.Android.MemoryGetAndroidHardwareBufferInfo *pointer)
 {
     pointer->SType  = StructureType.MemoryGetAndroidHardwareBufferInfo;
     pointer->Next   = null;
     pointer->Memory = this.Memory?.handle ?? default(SharpVk.Interop.DeviceMemory);
 }