Updated manager to have unique sequence added on default operations

This commit is contained in:
Alejandro Saucedo 2020-10-18 16:04:35 +01:00
parent 1053cde1f0
commit ba71c7ab46
3 changed files with 35 additions and 15 deletions

View file

@ -75,10 +75,20 @@ Sequence::begin()
return false;
}
if (this->isRunning()) {
SPDLOG_WARN("Kompute Sequence begin called when sequence still running");
return false;
}
if (!this->mCommandPool) {
throw std::runtime_error("Kompute Sequence command pool is null");
}
if (this->mOperations.size()) {
SPDLOG_INFO("Kompute Sequence clearing previous operations");
this->mOperations.clear();
}
if (!this->mRecording) {
SPDLOG_INFO("Kompute Sequence command recording BEGIN");
this->mCommandBuffer->begin(vk::CommandBufferBeginInfo());
@ -177,9 +187,10 @@ Sequence::evalAwait(uint64_t waitFor)
this->mDevice->waitForFences(1, &this->mFence, VK_TRUE, waitFor);
this->mDevice->destroy(this->mFence);
this->mIsRunning = false;
if (result == vk::Result::eTimeout) {
SPDLOG_WARN("Kompute Sequence evalAwait timed out");
this->mIsRunning = false;
return false;
}
@ -187,8 +198,6 @@ Sequence::evalAwait(uint64_t waitFor)
this->mOperations[i]->postEval();
}
this->mIsRunning = false;
return true;
}