diff --git a/include/core/fence.hpp b/include/core/fence.hpp index 6b9135d..bb921bd 100644 --- a/include/core/fence.hpp +++ b/include/core/fence.hpp @@ -43,7 +43,7 @@ namespace Vulkan::Core { /// @throws std::logic_error if the fence is not valid. /// @throws ls::vulkan_error if waiting fails. /// - bool wait(uint64_t timeout = UINT64_MAX); + [[nodiscard]] bool wait(uint64_t timeout = UINT64_MAX) const; /// Get the Vulkan handle. [[nodiscard]] auto handle() const { return *this->fence; } diff --git a/include/core/semaphore.hpp b/include/core/semaphore.hpp index e20c8c6..46c3683 100644 --- a/include/core/semaphore.hpp +++ b/include/core/semaphore.hpp @@ -48,7 +48,7 @@ namespace Vulkan::Core { /// @throws std::logic_error if the semaphore is not a timeline semaphore. /// @throws ls::vulkan_error if waiting fails. /// - bool wait(uint64_t value, uint64_t timeout = UINT64_MAX); + [[nodiscard]] bool wait(uint64_t value, uint64_t timeout = UINT64_MAX) const; /// Get the Vulkan handle. [[nodiscard]] auto handle() const { return *this->semaphore; } diff --git a/src/core/fence.cpp b/src/core/fence.cpp index 25a515d..7fd9088 100644 --- a/src/core/fence.cpp +++ b/src/core/fence.cpp @@ -36,7 +36,7 @@ void Fence::reset() const { throw ls::vulkan_error(res, "Unable to reset fence"); } -bool Fence::wait(uint64_t timeout) { +bool Fence::wait(uint64_t timeout) const { if (!this->isValid()) throw std::logic_error("Invalid fence"); diff --git a/src/core/semaphore.cpp b/src/core/semaphore.cpp index db4142b..0da15cb 100644 --- a/src/core/semaphore.cpp +++ b/src/core/semaphore.cpp @@ -47,7 +47,7 @@ void Semaphore::signal(uint64_t value) const { throw ls::vulkan_error(res, "Unable to signal semaphore"); } -bool Semaphore::wait(uint64_t value, uint64_t timeout) { +bool Semaphore::wait(uint64_t value, uint64_t timeout) const { if (!this->isValid() || !this->isTimeline) throw std::logic_error("Invalid timeline semaphore");