Updated algorithm to have option to build for both resultvalue and result

This commit is contained in:
Alejandro Saucedo
2020-10-08 07:51:33 +01:00
parent 3edb72be6a
commit eae63a32a2

View File

@@ -264,9 +264,20 @@ Algorithm::createPipeline(std::vector<uint32_t> specializationData)
&pipelineCacheInfo, nullptr, this->mPipelineCache.get());
this->mFreePipelineCache = true;
#ifdef KOMPUTE_CREATE_PIPELINE_RESULT_VALUE
vk::ResultValue<vk::Pipeline> pipelineResult =
this->mDevice->createComputePipeline(*this->mPipelineCache,
pipelineInfo);
if (pipelineResult.result != vk::Result::eSuccess) {
throw std::runtime_error("Failed to create pipeline result: " +
vk::to_string(pipelineResult.result));
}
#else
vk::Pipeline pipelineResult =
this->mDevice->createComputePipeline(*this->mPipelineCache, pipelineInfo);
this->mFreePipeline = true;
#endif
this->mFreePipeline = true;
this->mPipeline = std::make_shared<vk::Pipeline>(pipelineResult);