Exemplo n.º 1
0
        /// <summary>
        /// Get a POSIX file descriptor handle for a semaphore.
        /// </summary>
        /// <param name="semaphore">The semaphore from which state will be exported.</param>
        /// <param name="handleType">The type of handle requested.</param>
        /// <returns>The file descriptor representing the semaphore state.</returns>
        /// <exception cref="VulkanException">Vulkan returns an error code.</exception>
        public static int GetFdKhr(this Semaphore semaphore, ExternalSemaphoreHandleTypesKhr handleType)
        {
            int    fd;
            Result result = vkGetSemaphoreFdKHR(semaphore)(semaphore.Parent, semaphore, handleType, &fd);

            VulkanException.ThrowForInvalidResult(result);
            return(fd);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get a Windows HANDLE for a semaphore.
        /// </summary>
        /// <param name="semaphore">The semaphore from which state will be exported.</param>
        /// <param name="handleType">The type of handle requested.</param>
        /// <returns>The Windows handle representing the semaphore state.</returns>
        /// <exception cref="VulkanException">Vulkan returns an error code.</exception>
        public static IntPtr GetWin32HandleKhr(this Semaphore semaphore, ExternalSemaphoreHandleTypesKhr handleType)
        {
            IntPtr handle;
            Result result = vkGetSemaphoreWin32HandleKHR(semaphore)(semaphore.Parent, semaphore, handleType, &handle);

            VulkanException.ThrowForInvalidResult(result);
            return(handle);
        }