Exemple #1
0
 public static extern SharpVk.Result vkCreateEvent(SharpVk.Interop.Device device, SharpVk.Interop.EventCreateInfo *createInfo, SharpVk.Interop.AllocationCallbacks *allocator, SharpVk.Interop.Event * @event);
Exemple #2
0
 public static extern void vkCmdWaitEvents(SharpVk.Interop.CommandBuffer commandBuffer, uint eventCount, SharpVk.Interop.Event *events, SharpVk.PipelineStageFlags sourceStageMask, SharpVk.PipelineStageFlags destinationStageMask, uint memoryBarrierCount, SharpVk.Interop.MemoryBarrier *memoryBarriers, uint bufferMemoryBarrierCount, SharpVk.Interop.BufferMemoryBarrier *bufferMemoryBarriers, uint imageMemoryBarrierCount, SharpVk.Interop.ImageMemoryBarrier *imageMemoryBarriers);
Exemple #3
0
 /// <summary>
 ///
 /// </summary>
 public unsafe void WaitEvents(SharpVk.Event[] events, SharpVk.PipelineStageFlags sourceStageMask, SharpVk.PipelineStageFlags destinationStageMask, SharpVk.MemoryBarrier[] memoryBarriers, SharpVk.BufferMemoryBarrier[] bufferMemoryBarriers, SharpVk.ImageMemoryBarrier[] imageMemoryBarriers)
 {
     try
     {
         SharpVk.Interop.Event *              marshalledEvents               = default(SharpVk.Interop.Event *);
         SharpVk.Interop.MemoryBarrier *      marshalledMemoryBarriers       = default(SharpVk.Interop.MemoryBarrier *);
         SharpVk.Interop.BufferMemoryBarrier *marshalledBufferMemoryBarriers = default(SharpVk.Interop.BufferMemoryBarrier *);
         SharpVk.Interop.ImageMemoryBarrier * marshalledImageMemoryBarriers  = default(SharpVk.Interop.ImageMemoryBarrier *);
         if (events != null)
         {
             var fieldPointer = (SharpVk.Interop.Event *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.Event>(events.Length).ToPointer());
             for (int index = 0; index < (uint)(events.Length); index++)
             {
                 fieldPointer[index] = events[index]?.handle ?? default(SharpVk.Interop.Event);
             }
             marshalledEvents = fieldPointer;
         }
         else
         {
             marshalledEvents = null;
         }
         if (memoryBarriers != null)
         {
             var fieldPointer = (SharpVk.Interop.MemoryBarrier *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.MemoryBarrier>(memoryBarriers.Length).ToPointer());
             for (int index = 0; index < (uint)(memoryBarriers.Length); index++)
             {
                 memoryBarriers[index].MarshalTo(&fieldPointer[index]);
             }
             marshalledMemoryBarriers = fieldPointer;
         }
         else
         {
             marshalledMemoryBarriers = null;
         }
         if (bufferMemoryBarriers != null)
         {
             var fieldPointer = (SharpVk.Interop.BufferMemoryBarrier *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.BufferMemoryBarrier>(bufferMemoryBarriers.Length).ToPointer());
             for (int index = 0; index < (uint)(bufferMemoryBarriers.Length); index++)
             {
                 bufferMemoryBarriers[index].MarshalTo(&fieldPointer[index]);
             }
             marshalledBufferMemoryBarriers = fieldPointer;
         }
         else
         {
             marshalledBufferMemoryBarriers = null;
         }
         if (imageMemoryBarriers != null)
         {
             var fieldPointer = (SharpVk.Interop.ImageMemoryBarrier *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.ImageMemoryBarrier>(imageMemoryBarriers.Length).ToPointer());
             for (int index = 0; index < (uint)(imageMemoryBarriers.Length); index++)
             {
                 imageMemoryBarriers[index].MarshalTo(&fieldPointer[index]);
             }
             marshalledImageMemoryBarriers = fieldPointer;
         }
         else
         {
             marshalledImageMemoryBarriers = null;
         }
         Interop.Commands.vkCmdWaitEvents(this.handle, (uint)(events?.Length ?? 0), marshalledEvents, sourceStageMask, destinationStageMask, (uint)(memoryBarriers?.Length ?? 0), marshalledMemoryBarriers, (uint)(bufferMemoryBarriers?.Length ?? 0), marshalledBufferMemoryBarriers, (uint)(imageMemoryBarriers?.Length ?? 0), marshalledImageMemoryBarriers);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }