| 147 | } |
| 148 | |
| 149 | std::shared_ptr<Sequence> |
| 150 | Sequence::evalAwait(uint64_t waitFor) |
| 151 | { |
| 152 | if (!this->mIsRunning) { |
| 153 | KP_LOG_WARN("Kompute Sequence evalAwait called without existing eval"); |
| 154 | return shared_from_this(); |
| 155 | } |
| 156 | |
| 157 | vk::Result result = |
| 158 | this->mDevice->waitForFences(1, &this->mFence, VK_TRUE, waitFor); |
| 159 | this->mDevice->destroy( |
| 160 | this->mFence, (vk::Optional<const vk::AllocationCallbacks>)nullptr); |
| 161 | |
| 162 | this->mIsRunning = false; |
| 163 | |
| 164 | if (result == vk::Result::eTimeout) { |
| 165 | KP_LOG_WARN("Kompute Sequence evalAwait reached timeout of {}", |
| 166 | waitFor); |
| 167 | return shared_from_this(); |
| 168 | } |
| 169 | |
| 170 | for (size_t i = 0; i < this->mOperations.size(); i++) { |
| 171 | this->mOperations[i]->postEval(*this->mCommandBuffer); |
| 172 | } |
| 173 | |
| 174 | return shared_from_this(); |
| 175 | } |
| 176 | |
| 177 | bool |
| 178 | Sequence::isRunning() const |