Exemple #1
0
 /// <summary>
 /// Retrieve the index of the next available presentable image.
 /// </summary>
 public uint AcquireNextImage(ulong timeout, Semaphore semaphore, Fence fence)
 {
     unsafe
     {
         try
         {
             var               commandDelegate = this.commandCache.GetCommandDelegate <Interop.vkAcquireNextImageKHR>("vkAcquireNextImageKHR", "device");
             uint              result          = default(uint);
             Result            commandResult;
             Interop.Semaphore marshalledSemaphore = default(Interop.Semaphore);
             semaphore?.MarshalTo(&marshalledSemaphore);
             Interop.Fence marshalledFence = default(Interop.Fence);
             fence?.MarshalTo(&marshalledFence);
             commandResult = commandDelegate(this.associated.handle, this.handle, timeout, marshalledSemaphore, marshalledFence, &result);
             if (SharpVkException.IsError(commandResult))
             {
                 throw SharpVkException.Create(commandResult);
             }
             return(result);
         }
         finally
         {
             Interop.HeapUtil.FreeLog();
         }
     }
 }
Exemple #2
0
 internal Semaphore(Interop.Semaphore handle, Device parent, CommandCache commandCache)
 {
     this.handle       = handle;
     this.parent       = parent;
     this.commandCache = commandCache;
 }