Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
foray_externalsemaphore.hpp
Go to the documentation of this file.
1#pragma once
2#include "../core/foray_managedresource.hpp"
3
4namespace foray::util {
5
7 class ExternalSemaphore : public core::VulkanResource<VkObjectType::VK_OBJECT_TYPE_SEMAPHORE>
8 {
9 public:
10 void Create(core::Context* context);
11 inline virtual bool Exists() const override { return !!mSemaphore; }
12 virtual void Destroy() override;
13
14 FORAY_GETTER_V(Semaphore)
15 FORAY_GETTER_V(Handle)
16
17 inline operator VkSemaphore() const { return mSemaphore; }
18
19 protected:
21 VkSemaphore mSemaphore = nullptr;
22#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
23 HANDLE mHandle = INVALID_HANDLE_VALUE;
24#else
25 int mHandle = -1;
26#endif
27 };
28
29} // namespace foray::util
ManagedResource variant which automates GetTypeName() overloading by returning a stringified version ...
Definition foray_managedresource.hpp:59
Timeline Semaphore exposing handles for synchronization with other Apis (e.g. Cuda for OptiX denoisin...
Definition foray_externalsemaphore.hpp:8
void Create(core::Context *context)
int mHandle
Definition foray_externalsemaphore.hpp:25
virtual void Destroy() override
Destroy the resource.
VkSemaphore mSemaphore
Definition foray_externalsemaphore.hpp:21
virtual bool Exists() const override
Return true, if the managed resource is allocated.
Definition foray_externalsemaphore.hpp:11
core::Context * mContext
Definition foray_externalsemaphore.hpp:20
#define FORAY_GETTER_V(member)
Return value.
Definition foray_basics.hpp:39
Definition foray_dualbuffer.hpp:5
Non owning context object.
Definition foray_context.hpp:16