Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
src
util
foray_externalsemaphore.hpp
Go to the documentation of this file.
1
#pragma once
2
#include "../core/foray_managedresource.hpp"
3
4
namespace
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
:
20
core::Context
*
mContext
=
nullptr
;
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
foray::core::VulkanResource
ManagedResource variant which automates GetTypeName() overloading by returning a stringified version ...
Definition
foray_managedresource.hpp:59
foray::util::ExternalSemaphore
Timeline Semaphore exposing handles for synchronization with other Apis (e.g. Cuda for OptiX denoisin...
Definition
foray_externalsemaphore.hpp:8
foray::util::ExternalSemaphore::Create
void Create(core::Context *context)
foray::util::ExternalSemaphore::mHandle
int mHandle
Definition
foray_externalsemaphore.hpp:25
foray::util::ExternalSemaphore::Destroy
virtual void Destroy() override
Destroy the resource.
foray::util::ExternalSemaphore::mSemaphore
VkSemaphore mSemaphore
Definition
foray_externalsemaphore.hpp:21
foray::util::ExternalSemaphore::Exists
virtual bool Exists() const override
Return true, if the managed resource is allocated.
Definition
foray_externalsemaphore.hpp:11
foray::util::ExternalSemaphore::mContext
core::Context * mContext
Definition
foray_externalsemaphore.hpp:20
FORAY_GETTER_V
#define FORAY_GETTER_V(member)
Return value.
Definition
foray_basics.hpp:39
foray::util
Definition
foray_dualbuffer.hpp:5
foray::core::Context
Non owning context object.
Definition
foray_context.hpp:16
Generated by
1.9.8