diff --git a/include/avk/commands.hpp b/include/avk/commands.hpp index 48525be..1525cab 100644 --- a/include/avk/commands.hpp +++ b/include/avk/commands.hpp @@ -1107,6 +1107,18 @@ namespace avk #endif } + /** Helper struct to specify a semaphore and a signal value for it. + * This is used for timeline semaphores. + */ + struct semaphore_value_info + { + avk::resource_argument mSemaphore; + uint64_t mValue; + }; + inline semaphore_value_info operator,(avk::resource_argument aSemaphore, uint64_t aValue) { + return semaphore_value_info{std::move(aSemaphore), aValue}; + } + struct semaphore_wait_info { avk::resource_argument mWaitSemaphore; @@ -1124,14 +1136,10 @@ namespace avk return semaphore_wait_info{ std::move(aSemaphore), aStageFlags, 0 }; } - /** Helper struct to specify a semaphore and a signal value for it. - * This is used for timeline semaphores. - */ - struct semaphore_value_info + inline semaphore_wait_info operator>> (semaphore_value_info aSemaphoreValueInfo, avk::stage::pipeline_stage_flags aStageFlags) { - avk::resource_argument mSignalSemaphore; - uint64_t mValue; - }; + return semaphore_wait_info{ std::move(aSemaphoreValueInfo.mSemaphore), aStageFlags, aSemaphoreValueInfo.mValue }; + } struct semaphore_signal_info { @@ -1144,21 +1152,10 @@ namespace avk { return semaphore_signal_info{ aStageFlags, std::move(aSemaphore), 0 }; } - - inline semaphore_value_info operator>> (avk::resource_argument aSemaphore, uint64_t aSemaphoreValue) - { - return semaphore_value_info{ std::move(aSemaphore), aSemaphoreValue }; - } inline semaphore_signal_info operator>> (avk::stage::pipeline_stage_flags aStageFlags, semaphore_value_info aSemaphoreValueInfo) { - return semaphore_signal_info{ aStageFlags, std::move(aSemaphoreValueInfo.mSignalSemaphore), aSemaphoreValueInfo.mValue }; - } - - inline semaphore_signal_info operator>> (avk::semaphore_signal_info aSemaphoreSignalInfo, uint64_t aSemaphoreValue) - { - aSemaphoreSignalInfo.mValue = aSemaphoreValue; - return aSemaphoreSignalInfo; + return semaphore_signal_info{ aStageFlags, std::move(aSemaphoreValueInfo.mSemaphore), aSemaphoreValueInfo.mValue }; } class recorded_command_buffer; diff --git a/src/avk.cpp b/src/avk.cpp index c8de163..fc15d67 100644 --- a/src/avk.cpp +++ b/src/avk.cpp @@ -7149,12 +7149,12 @@ namespace avk return vk::Result::eSuccess; } - const vk::Device& device = aSemaphoreValueInfos.front().mSignalSemaphore->mSemaphore.getOwner(); + const vk::Device& device = aSemaphoreValueInfos.front().mSemaphore->mSemaphore.getOwner(); std::vector semHandles; std::vector timestampValues; for (const auto& svi : aSemaphoreValueInfos) { - assert(device == svi.mSignalSemaphore->mSemaphore.getOwner()); - semHandles.push_back(svi.mSignalSemaphore->handle()); + assert(device == svi.mSemaphore->mSemaphore.getOwner()); + semHandles.push_back(svi.mSemaphore->handle()); timestampValues.push_back(svi.mValue); }