Beispiel #1
0
        public unsafe Fence(Device device, bool isSignaled = false)
        {
            _device = device;
            var createInfo = new VkFenceCreateInfo
            {
                sType = VkStructureType.FenceCreateInfo,
                flags = (
                    isSignaled ?
                    VkFenceCreateFlags.Signaled :
                    VkFenceCreateFlags.None
                    )
            };

            VkFence fence;

            if (VulkanNative.vkCreateFence(
                    device.Handle,
                    &createInfo,
                    null,
                    &fence
                    ) != VkResult.Success)
            {
                throw new Exception("failed to create fence");
            }
            _handle = fence;
        }