Added functionality for named sequences to be created

This commit is contained in:
Alejandro Saucedo 2020-08-28 15:19:39 +01:00
parent c8db55aa1b
commit b91c392f5e
15 changed files with 299 additions and 173 deletions

View file

@ -19,9 +19,6 @@ Sequence::Sequence(std::shared_ptr<vk::PhysicalDevice> physicalDevice,
this->mDevice = device;
this->mComputeQueue = computeQueue;
this->mQueueIndex = queueIndex;
this->createCommandPool();
this->createCommandBuffer();
}
Sequence::~Sequence()
@ -58,10 +55,17 @@ Sequence::~Sequence()
}
}
void
Sequence::init()
{
this->createCommandPool();
this->createCommandBuffer();
}
void
Sequence::begin()
{
if (this->mCommandPool == nullptr) {
if (!this->mCommandPool) {
throw std::runtime_error("Kompute Sequence command pool is null");
}
@ -78,7 +82,7 @@ Sequence::begin()
void
Sequence::end()
{
if (this->mCommandPool == nullptr) {
if (!this->mCommandPool) {
throw std::runtime_error("Kompute Sequence command pool is null");
}
@ -125,7 +129,7 @@ Sequence::createCommandPool()
{
SPDLOG_DEBUG("Kompute Sequence creating command pool");
if (this->mDevice == nullptr) {
if (!this->mDevice) {
throw std::runtime_error("Kompute Sequence device is null");
}
if (this->mQueueIndex < 0) {
@ -146,10 +150,10 @@ void
Sequence::createCommandBuffer()
{
SPDLOG_DEBUG("Kompute Sequence creating command buffer");
if (this->mDevice == nullptr) {
if (!this->mDevice) {
throw std::runtime_error("Kompute Sequence device is null");
}
if (this->mCommandPool == nullptr) {
if (!this->mCommandPool) {
throw std::runtime_error("Kompute Sequence command pool is null");
}