40 lines
1006 B
C++
40 lines
1006 B
C++
#include "./fence.hpp"
|
|
|
|
#include "./device.hpp"
|
|
|
|
using vk::fence;
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
bool
|
|
fence::is_ready (const device &dev)
|
|
{
|
|
auto res = vkGetFenceStatus (dev.id (), id ());
|
|
error::try_code (res);
|
|
return res == VK_SUCCESS;
|
|
}
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
void
|
|
fence::reset (const device &dev, fence *first, fence *last)
|
|
{
|
|
vkResetFences (dev.id (), last - first, &first->id ());
|
|
}
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
void
|
|
fence::wait (const device &d, fence *first, fence *last, uint64_t timeout)
|
|
{
|
|
vkWaitForFences (d.id (), last - first, &first->id (), VK_FALSE, timeout);
|
|
}
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
void
|
|
fence::wait_all (const device &d, fence *first, fence *last, uint64_t timeout)
|
|
{
|
|
vkWaitForFences (d.id (), last - first, &first->id (), VK_TRUE, timeout);
|
|
}
|