Loading...
Searching...
No Matches
VkCudaSemaphore.hpp
Go to the documentation of this file.
1#pragma once
2
34#include <Gfx/Graph/interop/CudaInterop.h>
36
37#include <score_plugin_gfx_export.h>
38
39#include <cstdint>
40
41#if QT_HAS_VULKAN
42
43namespace score::gfx::vkinterop
44{
45
48class SCORE_PLUGIN_GFX_EXPORT VkCudaTimelineSemaphore
49{
50public:
51 VkCudaTimelineSemaphore() = default;
52 ~VkCudaTimelineSemaphore();
53
54 VkCudaTimelineSemaphore(const VkCudaTimelineSemaphore&) = delete;
55 VkCudaTimelineSemaphore& operator=(const VkCudaTimelineSemaphore&) = delete;
56 VkCudaTimelineSemaphore(VkCudaTimelineSemaphore&&) noexcept;
57 VkCudaTimelineSemaphore& operator=(VkCudaTimelineSemaphore&&) noexcept;
58
70 bool create(const VulkanCtx& vk, CudaInteropContextHandle cudaCtx,
71 uint64_t initialValue = 0, bool binary = false);
72
74 void destroy() noexcept;
75
76 bool valid() const noexcept;
77
80 VkSemaphore vk() const noexcept { return m_vkSem; }
81
84 CudaInteropSemaphoreHandle cuda() const noexcept { return m_cudaSem; }
85
89 bool hostSignal(uint64_t value);
90
91private:
92 VulkanCtx m_vk{};
93 CudaInteropContextHandle m_cudaCtx{};
94 VkSemaphore m_vkSem{VK_NULL_HANDLE};
95 CudaInteropSemaphoreHandle m_cudaSem{};
96};
97
98} // namespace score::gfx::vkinterop
99
100#endif // QT_HAS_VULKAN
Vulkan external-memory image/buffer create + export + import helpers.