public static void vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits srcStageMask, VkPipelineStageFlagBits dstStageMask, int dependencyFlags, int memoryBarrierCount, VkMemoryBarrier[] pMemoryBarriers, int bufferMemoryBarrierCount, VkBufferMemoryBarrier[] pBufferMemoryBarriers, int imageMemoryBarrierCount, VkImageMemoryBarrier[] pImageMemoryBarriers) { bool hasBarrier = false; VkPreconditions.CheckNull(commandBuffer, nameof(commandBuffer)); if (memoryBarrierCount != 0) { hasBarrier = true; VkPreconditions.CheckNull(pMemoryBarriers, nameof(pMemoryBarriers)); VkPreconditions.CheckRange(memoryBarrierCount, 1, pMemoryBarriers.Length, nameof(memoryBarrierCount)); } if (bufferMemoryBarrierCount != 0) { hasBarrier = true; VkPreconditions.CheckNull(pBufferMemoryBarriers, nameof(pBufferMemoryBarriers)); VkPreconditions.CheckRange(bufferMemoryBarrierCount, 1, pBufferMemoryBarriers.Length, nameof(bufferMemoryBarrierCount)); } if (imageMemoryBarrierCount != 0) { hasBarrier = true; VkPreconditions.CheckNull(pImageMemoryBarriers, nameof(pImageMemoryBarriers)); VkPreconditions.CheckRange(imageMemoryBarrierCount, 1, pImageMemoryBarriers.Length, nameof(imageMemoryBarrierCount)); } VkPreconditions.CheckOperation(!hasBarrier, ("At least one type of barrier must be informed on the command")); GetCommandBuffer(commandBuffer).CmdPipelineBarrier(srcStageMask, dstStageMask, dependencyFlags, memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers, imageMemoryBarrierCount, pImageMemoryBarriers); }