Skip to content

Commit a379e94

Browse files
committed
resetFences return bool
1 parent 894c8ac commit a379e94

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

include/nbl/video/ILogicalDevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class ILogicalDevice : public core::IReferenceCounted
124124

125125
virtual core::smart_refctd_ptr<IGPUFence> createFence(IGPUFence::E_CREATE_FLAGS _flags) = 0;
126126
virtual IGPUFence::E_STATUS getFenceStatus(IGPUFence* _fence) = 0;
127-
virtual void resetFences(uint32_t _count, IGPUFence*const * _fences) = 0;
127+
virtual bool resetFences(uint32_t _count, IGPUFence*const * _fences) = 0;
128128
virtual IGPUFence::E_STATUS waitForFences(uint32_t _count, IGPUFence* const* _fences, bool _waitAll, uint64_t _timeout) = 0;
129129
// Forever waiting variant if you're confident that the fence will eventually be signalled
130130
inline bool blockForFences(uint32_t _count, IGPUFence* const* _fences, bool _waitAll = true)

src/nbl/video/COpenGL_LogicalDevice.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,11 @@ class COpenGL_LogicalDevice : public IOpenGL_LogicalDevice
299299
return retval;
300300
}
301301

302-
void resetFences(uint32_t _count, IGPUFence*const * _fences) override final
302+
bool resetFences(uint32_t _count, IGPUFence*const * _fences) override final
303303
{
304304
for (uint32_t i = 0u; i < _count; ++i)
305305
static_cast<COpenGLFence*>(_fences[i])->reset();
306+
return true;
306307
}
307308

308309
IGPUFence::E_STATUS waitForFences(uint32_t _count, IGPUFence* const* _fences, bool _waitAll, uint64_t _timeout) override final

src/nbl/video/CVulkanLogicalDevice.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class CVulkanLogicalDevice final : public ILogicalDevice
140140
}
141141

142142
// API needs to change. vkResetFences can fail.
143-
void resetFences(uint32_t _count, IGPUFence*const* _fences) override
143+
bool resetFences(uint32_t _count, IGPUFence*const* _fences) override
144144
{
145145
constexpr uint32_t MAX_FENCE_COUNT = 100u;
146146
assert(_count < MAX_FENCE_COUNT);
@@ -149,12 +149,13 @@ class CVulkanLogicalDevice final : public ILogicalDevice
149149
for (uint32_t i = 0u; i < _count; ++i)
150150
{
151151
if (_fences[i]->getAPIType() != EAT_VULKAN)
152-
return;
152+
return false;
153153

154154
vk_fences[i] = static_cast<CVulkanFence*>(_fences[i])->getInternalObject();
155155
}
156156

157-
m_devf.vk.vkResetFences(m_vkdev, _count, vk_fences);
157+
auto vk_res = m_devf.vk.vkResetFences(m_vkdev, _count, vk_fences);
158+
return (vk_res == VK_SUCCESS);
158159
}
159160

160161
IGPUFence::E_STATUS waitForFences(uint32_t _count, IGPUFence*const* _fences, bool _waitAll, uint64_t _timeout) override

0 commit comments

Comments
 (0)